linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gssd: ensure that preferred_realm is non-NULL before passing it to strcmp
@ 2014-09-08 16:35 Jeff Layton
  2014-09-16 13:30 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2014-09-08 16:35 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

It's possible for "preferred_realm" to be NULL, in which case we
don't want to pass it to strcmp. Other places that use this variable
test whether it's NULL first -- we need to do the same here.

This should fix the gssd crash reported here:

    https://bugzilla.redhat.com/show_bug.cgi?id=1108615

Reported-by: Brian J. Murrell <brian@interlinx.bc.ca>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 utils/gssd/krb5_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 8369fdf0ed27..f1ebc0d09731 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -876,7 +876,7 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
 	i = 0;
 	realm = realmnames[i];
 
-	if (strcmp (realm, preferred_realm) != 0) {
+	if (preferred_realm && strcmp (realm, preferred_realm) != 0) {
 		realm = preferred_realm;
 		/* resetting the realmnames index */
 		i = -1;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-16 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 16:35 [PATCH] gssd: ensure that preferred_realm is non-NULL before passing it to strcmp Jeff Layton
2014-09-16 13:30 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).