sudo_krb5_ccname_path: avoid gcc false positive for ccname being NULL

The callers all verify that they don't pass a NULL ccname so I'm
not sure how the compiler is getting confused (and why now?).
This commit is contained in:
Todd C. Miller
2023-07-10 15:21:31 -06:00
parent c6a11b4fed
commit dc1a5d7b40

View File

@@ -483,6 +483,9 @@ sudo_krb5_ccname_path(const char *old_ccname)
const char *ccname = old_ccname; const char *ccname = old_ccname;
debug_decl(sudo_krb5_ccname_path, SUDOERS_DEBUG_LDAP); debug_decl(sudo_krb5_ccname_path, SUDOERS_DEBUG_LDAP);
if (ccname == NULL)
debug_return_const_str(NULL);
/* Strip off leading FILE: or WRFILE: prefix. */ /* Strip off leading FILE: or WRFILE: prefix. */
switch (ccname[0]) { switch (ccname[0]) {
case 'F': case 'F':