]> git.ipfire.org Git - thirdparty/openssl.git/commit
apps/ocsp.c: avoid using NULL resp
authorEugene Syromiatnikov <esyr@openssl.org>
Mon, 1 Sep 2025 14:42:15 +0000 (16:42 +0200)
committerNeil Horman <nhorman@openssl.org>
Sat, 6 Sep 2025 14:11:45 +0000 (10:11 -0400)
commite59fa197bafa0dbbff33ce2dee772539a6e70e9e
treece05d18e02fb3dbaf0c5ba4d7a643b67fbeaef90
parent3b83a7183c71395cdc70eacddce21f4d2d9d2b88
apps/ocsp.c: avoid using NULL resp

There are some code paths where resp is used without a previous check
for being non-NULL (specifically, OCSP_response_create() can return
NULL, and do_responder() can return -1, that would also lead to resp
being NULL).  Avoid hitting NULL dereferences by wrapping the code that
uses resp in "if (resp != NULL)".

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665155
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28408)
apps/ocsp.c