summaryrefslogtreecommitdiff
path: root/lib/libcrypto/objects/obj_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/objects/obj_lib.c')
-rw-r--r--lib/libcrypto/objects/obj_lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/objects/obj_lib.c b/lib/libcrypto/objects/obj_lib.c
index b0b0f2ff24b..706fa0b0e78 100644
--- a/lib/libcrypto/objects/obj_lib.c
+++ b/lib/libcrypto/objects/obj_lib.c
@@ -82,7 +82,8 @@ ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
r->data=OPENSSL_malloc(o->length);
if (r->data == NULL)
goto err;
- memcpy(r->data,o->data,o->length);
+ if (o->data != NULL)
+ memcpy(r->data,o->data,o->length);
r->length=o->length;
r->nid=o->nid;
r->ln=r->sn=NULL;