Convert CRYPTO_LOCK_X509_* to new multi-threading API
[openssl.git] / crypto / x509v3 / v3_alt.c
index b2914ee6df19300fc6b2e30b015b5ccd9c72754a..4b143f95c83fa2c8f53912ef1b9ce6e415838465 100644 (file)
@@ -577,11 +577,9 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
     if ((gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx)) == NULL)
         return 0;
     objlen = p - value;
-    objtmp = OPENSSL_malloc(objlen + 1);
+    objtmp = OPENSSL_strndup(value, objlen);
     if (objtmp == NULL)
         return 0;
-    strncpy(objtmp, value, objlen);
-    objtmp[objlen] = 0;
     gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
     OPENSSL_free(objtmp);
     if (!gen->d.otherName->type_id)