sudo_ldap_parse_option: add explicit NULL check for strchr().

This should not be needed since we only use the returned pointer
if it is larger than the string passed to strchr().
Quiets a warning from Infer.
This commit is contained in:
Todd C. Miller
2022-11-22 11:17:30 -07:00
parent a0d9963fe6
commit 2f97da316e

View File

@@ -77,7 +77,7 @@ sudo_ldap_parse_option(char *optstr, char **varp, char **valp)
/* check for equals sign past first char */
cp = strchr(var, '=');
if (cp > var) {
if (cp != NULL && cp > var) {
val = cp + 1;
op = cp[-1]; /* peek for += or -= cases */
if (op == '+' || op == '-') {