Commit 4553c792c3 for openssl.org

commit 4553c792c3954fb0ec8d405677cd0591027d3e58
Author: Bob Beck <beck@openssl.org>
Date:   Wed Feb 18 09:55:17 2026 -0700

    Fix misplaced check spotted by vitkor

    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)

diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index ddf1a923fc..54cef44f59 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -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;