]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto: x509: fix unreachable code in X509V3_get_section and X509V3_get_string
authorAnton Moryakov <ant.v.moryakov@gmail.com>
Thu, 22 Jan 2026 14:51:12 +0000 (17:51 +0300)
committerTomas Mraz <tomas@openssl.org>
Mon, 26 Jan 2026 15:27:52 +0000 (16:27 +0100)
commita3e67efa015ca68f2e2be00889d92612f5bb5040
tree13aee40c2d22860db9c43ff60720787f25f54afd
parent6d2f848f9463d05d1c00f70b1d024fad9ef03a5d
crypto: x509: fix unreachable code in X509V3_get_section and X509V3_get_string

The functions X509V3_get_section() and X509V3_get_string() contain a
redundant null check after an identical check has already guaranteed
that the function pointer (ctx->db_meth->get_section / get_string) is
non-NULL. As a result, the final 'return NULL;' statement is unreachable.

This change removes the redundant condition and the dead code, improving
code clarity and eliminating warnings from static analyzers.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
MergeDate: Mon Jan 26 15:28:01 2026
(Merged from https://github.com/openssl/openssl/pull/29692)
crypto/x509/v3_conf.c