]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix misplaced check spotted by vitkor
authorBob Beck <beck@openssl.org>
Wed, 18 Feb 2026 16:55:17 +0000 (09:55 -0700)
committerNeil Horman <nhorman@openssl.org>
Tue, 24 Feb 2026 14:03:39 +0000 (09:03 -0500)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
MergeDate: Tue Feb 24 14:04:45 2026
(Merged from https://github.com/openssl/openssl/pull/29612)

crypto/x509/x509_vpm.c

index ddf1a923fc9b66a868c07a132c7f3076932fc9a4..54cef44f591a7fa4df4fd7017c4418be5b61d817 100644 (file)
@@ -844,13 +844,13 @@ static const unsigned char *int_X509_VERIFY_PARAM_get0_ip(X509_VERIFY_PARAM *par
     if (idx > INT_MAX)
         return NULL;
 
-    buf = sk_X509_BUFFER_value(param->ips, (int)idx);
-
     if (param == NULL || param->ips == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return NULL;
     }
 
+    buf = sk_X509_BUFFER_value(param->ips, (int)idx);
+
     if (buf != NULL) {
         if (plen != NULL)
             *plen = buf->len;