RT4320/GH705: Fix PEM parsing bug.
[openssl.git] / crypto / ocsp / v3_ocsp.c
index ab8c4376b158465a52a22f42b84c33496df6cbd2..142deac54e44597387a44573a26335cb97964c75 100644 (file)
@@ -1,4 +1,3 @@
-/* v3_ocsp.c */
 /*
  * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
  * 1999.
@@ -234,10 +233,13 @@ static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length)
 {
     ASN1_OCTET_STRING *os, **pos;
     pos = a;
-    if (!pos || !*pos)
+    if (pos == NULL || *pos == NULL) {
         os = ASN1_OCTET_STRING_new();
-    else
+        if (os == NULL)
+            goto err;
+    } else {
         os = *pos;
+    }
     if (!ASN1_OCTET_STRING_set(os, *pp, length))
         goto err;