Fix some missing OBJ_dup failure checks.
authorFdaSilvaYY <fdasilvayy@gmail.com>
Wed, 11 May 2016 22:29:22 +0000 (00:29 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 16 May 2016 08:28:25 +0000 (10:28 +0200)
Fix some missing OBJ_dup failure checks.
Merged from
https://boringssl.googlesource.com/boringssl/+/0ce78a757d815c0dde9ed5884229f3a5b2cb3e9c%5E!

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1057)

crypto/x509/x509_att.c
crypto/x509/x509_v3.c

index fb04cdcf68d0d4fa7b4958d68fde172689ac4e4f..8e2abdf52ab17e2f084ef3f2572a41f4e34bdb23 100644 (file)
@@ -288,7 +288,7 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
         return (0);
     ASN1_OBJECT_free(attr->object);
     attr->object = OBJ_dup(obj);
-    return (1);
+    return attr->object != NULL;
 }
 
 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
index f3fe3057573358ea2429ae6fe5641907c7516094..e835db79067606ea86b6f5bb27548242a7df482e 100644 (file)
@@ -235,7 +235,7 @@ int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj)
         return (0);
     ASN1_OBJECT_free(ex->object);
     ex->object = OBJ_dup(obj);
-    return (1);
+    return ex->object != NULL;
 }
 
 int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit)