summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/v3_alt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_alt.c')
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c
index 66ea96db51..8de5dd041b 100644
--- a/src/lib/libcrypto/x509v3/v3_alt.c
+++ b/src/lib/libcrypto/x509v3/v3_alt.c
@@ -579,10 +579,12 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
579 return 0; 579 return 0;
580 objlen = p - value; 580 objlen = p - value;
581 objtmp = OPENSSL_malloc(objlen + 1); 581 objtmp = OPENSSL_malloc(objlen + 1);
582 strncpy(objtmp, value, objlen); 582 if (objtmp) {
583 objtmp[objlen] = 0; 583 strlcpy(objtmp, value, objlen + 1);
584 gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); 584 gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
585 OPENSSL_free(objtmp); 585 OPENSSL_free(objtmp);
586 } else
587 gen->d.otherName->type_id = NULL;
586 if (!gen->d.otherName->type_id) 588 if (!gen->d.otherName->type_id)
587 return 0; 589 return 0;
588 return 1; 590 return 1;