diff options
-rw-r--r-- | crypto/objects/obj_dat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 2f86cd5e46..f8c1db3c83 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -684,7 +684,8 @@ int OBJ_create(const char *oid, const char *sn, const char *ln) int ok = 0; /* Check to see if short or long name already present */ - if (OBJ_sn2nid(sn) != NID_undef || OBJ_ln2nid(ln) != NID_undef) { + if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef) + || (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) { OBJerr(OBJ_F_OBJ_CREATE, OBJ_R_OID_EXISTS); return 0; } |