Fix segfaults in BN_dec2bn() and BN_hex2bn()
authortb <tb@openbsd.org>
Tue, 22 Nov 2022 08:46:27 +0000 (08:46 +0000)
committertb <tb@openbsd.org>
Tue, 22 Nov 2022 08:46:27 +0000 (08:46 +0000)
commit2eadc686be89b55c2ec1d0d7464746f72f5ee509
treec536db914d6424e06b40e16751c40bbf6e5cee24
parentf6aae1a85c0e81b82089b6bde54acdd9f5080105
Fix segfaults in BN_dec2bn() and BN_hex2bn()

bn_print.c r1.29 added length checks to avoid overflowing the BIGNUM.
If these checks are hit in length-only mode, i.e., bn is NULL, the
error path dereferences bn. Change goto err to an early return to
avoid this.

ok jsing
lib/libcrypto/bn/bn_print.c