]> git.ipfire.org Git - thirdparty/openssl.git/commit
x509_vfy: remove redundant stack allocation
authorBenjamin Kaduk <bkaduk@akamai.com>
Fri, 12 Feb 2021 00:10:50 +0000 (16:10 -0800)
committerShane Lontis <shane.lontis@oracle.com>
Mon, 15 Feb 2021 04:08:28 +0000 (14:08 +1000)
commit63ae8476796510c15163c9bd18998ccef6c1de16
treeee05d6cdfbb84bb22f1fe83a15f1f7d25867a0f5
parent99c166a1b0408e6d5c6efdc402fa859652048751
x509_vfy: remove redundant stack allocation

Fix CID 1472833 by removing a codepath that attempts to allocate a
stack if not already allocated, when the stack was already allocated
unconditionally a few lines previously.

Interestingly enough, this additional allocation path (and the comment
describing the need for it) were added in commit
69664d6af0cdd7738f55d10fbbe46cdf15f72e0e, also prompted by Coverity(!).
It seems that the intervening (and much more recent) commit
d53b437f9992f974c1623e9b9b9bdf053aefbcc3 that allowed sk_X509_dup()
to accept a NULL argument allowed the earlier initialization path
to unconditionally allocate a stack, rendering this later allocation fully
redundant.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14161)
crypto/x509/x509_vfy.c