Fix missing null check
Don't add 1 if strchr returns NULL
PR update
Fixes
@@ -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++;
}
}
