From: Graham Woodward Date: Tue, 27 Sep 2022 12:21:10 +0000 (+0100) Subject: Fix missing null check X-Git-Tag: openssl-3.2.0-alpha1~1983 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b85d53c1670e47273827bba508daff310c3263ab;p=thirdparty%2Fopenssl.git Fix missing null check Don't add 1 if strchr returns NULL PR update Fixes #19279 Reviewed-by: David von Oheimb Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19282) --- diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c index b8e4558e0de..04acf49dee4 100644 --- a/crypto/cmp/cmp_util.c +++ b/crypto/cmp/cmp_util.c @@ -100,8 +100,8 @@ const char *ossl_cmp_log_parse_metadata(const char *buf, *file = OPENSSL_strndup(p_file, p_line - 1 - p_file); /* no real problem if OPENSSL_strndup() returns NULL */ *line = (int)line_number; - msg = strchr(p_level, ':') + 1; - if (*msg == ' ') + msg = strchr(p_level, ':'); + if (msg != NULL && *++msg == ' ') msg++; } }