Fix the null pointer dereference
authorKan <chenxinpingc2306@163.com>
Thu, 16 Dec 2021 16:05:24 +0000 (00:05 +0800)
committerPauli <pauli@openssl.org>
Sun, 19 Dec 2021 23:55:57 +0000 (10:55 +1100)
Fixes #17296

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17297)

crypto/bn/bn_conv.c

index 4af546a25b8e240e55d67265a6827df88a95795c..6757f3d0aae98c4c5f82a70a7b8963beae85ad6e 100644 (file)
@@ -142,7 +142,7 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
         continue;
 
     if (i == 0 || i > INT_MAX / 4)
-        goto err;
+        return 0;
 
     num = i + neg;
     if (bn == NULL)