From dc1a5d7b40b80b23ed78450df9a13037aa56b737 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 10 Jul 2023 15:21:31 -0600 Subject: [PATCH] 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?). --- plugins/sudoers/ldap_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/sudoers/ldap_conf.c b/plugins/sudoers/ldap_conf.c index ec11692a0..11d1b7f2f 100644 --- a/plugins/sudoers/ldap_conf.c +++ b/plugins/sudoers/ldap_conf.c @@ -483,6 +483,9 @@ sudo_krb5_ccname_path(const char *old_ccname) const char *ccname = old_ccname; debug_decl(sudo_krb5_ccname_path, SUDOERS_DEBUG_LDAP); + if (ccname == NULL) + debug_return_const_str(NULL); + /* Strip off leading FILE: or WRFILE: prefix. */ switch (ccname[0]) { case 'F':