sudo_ldap_netgroup_match_str: "-" in a netgroup can never match.

We already check for a NULL value above so "str == NULL" is always
false.  Found by PVS-Studio.
This commit is contained in:
Todd C. Miller
2023-03-15 10:06:04 -06:00
parent 027b42d5a6
commit b965d222d8

View File

@@ -73,7 +73,7 @@ sudo_ldap_netgroup_match_str(const char *str, const char *ngstr, size_t nglen,
}
if (*ngstr == '-' && nglen == 1) {
/* '-' means no valid value. */
debug_return_bool(str == NULL);
debug_return_bool(false);
}
if (ignore_case) {
if (strncasecmp(str, ngstr, nglen) == 0 && str[nglen] == '\0')