]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/ocsp/ocsp_ext.c
Fix incomplete check on X509V3_add1_i2d()
[thirdparty/openssl.git] / crypto / ocsp / ocsp_ext.c
index c2b61bd4f2c43a738541104667b221f395339cb6..753b30ce47a792d9f760417a37143715b8647152 100644 (file)
@@ -268,8 +268,8 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts,
         memcpy(tmpval, val, len);
     else if (RAND_bytes(tmpval, len) <= 0)
         goto err;
-    if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
-                         &os, 0, X509V3_ADD_REPLACE))
+    if (X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
+                         &os, 0, X509V3_ADD_REPLACE) <= 0)
         goto err;
     ret = 1;
  err: