diff options
author | Graham Woodward <graham.woodward@ibm.com> | 2022-09-27 13:21:10 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2022-09-30 22:42:17 +0200 |
commit | b85d53c1670e47273827bba508daff310c3263ab (patch) | |
tree | 17d72f46f7eba7ba7363f07ec1ebba9dab34c271 /crypto/cmp | |
parent | bd07cc1c7e3ca38689e59868b5945dc223235a49 (diff) |
Fix missing null check
Don't add 1 if strchr returns NULL
PR update
Fixes #19279
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19282)
Diffstat (limited to 'crypto/cmp')
-rw-r--r-- | crypto/cmp/cmp_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c index b8e4558e0d..04acf49dee 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++; } } |