Replace strdup() with BUF_strdup().
[openssl.git] / crypto / x509v3 / v3_addr.c
index 8ba22548560f9ef48416c3207dfd0c775f168718..b9be9995e16938f175a534466db9c30f112f708e 100644 (file)
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include <openssl/buffer.h>
 #include <openssl/x509v3.h>
 
-#ifdef OPENSSL_RFC3779
+#ifndef OPENSSL_NO_RFC3779
 
 /*
  * OpenSSL ASN.1 template translation of RFC 3779 2.2.3.
@@ -934,7 +935,7 @@ static void *v2i_IPAddrBlocks(struct v3_ext_method *method,
     length = length_from_afi(afi);
 
     /*
-     * Handle SAFI, if any, and strdup() so we can null-terminate
+     * Handle SAFI, if any, and BUF_strdup() so we can null-terminate
      * the other input values.
      */
     if (safi != NULL) {
@@ -946,9 +947,9 @@ static void *v2i_IPAddrBlocks(struct v3_ext_method *method,
        goto err;
       }
       t += strspn(t, " \t");
-      s = strdup(t);
+      s = BUF_strdup(t);
     } else {
-      s = strdup(val->value);
+      s = BUF_strdup(val->value);
     }
     if (s == NULL) {
       X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
@@ -1277,4 +1278,4 @@ int v3_addr_validate_resource_set(STACK_OF(X509) *chain,
   return v3_addr_validate_path_internal(NULL, chain, ext);
 }
 
-#endif /* OPENSSL_RFC3779 */
+#endif /* OPENSSL_NO_RFC3779 */