From: Bernhard Rosenkränzer Date: Thu, 26 Jan 2017 15:48:48 +0000 (+0100) Subject: Don't crash on bogus keys in login.defs if PAM is enabled X-Git-Tag: 4.5~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c33ceddc263514440dc49605fd22658eaaae38c0;p=shadow Don't crash on bogus keys in login.defs if PAM is enabled Without this patch, PAM enabled builds crash when encountering an invalid key in login.defs or key overrides because of array overflows To reproduce, simply useradd -K Windows=broken Signed-off-by: Bernhard Rosenkränzer Signed-off-by: Serge Hallyn --- diff --git a/lib/getdef.c b/lib/getdef.c index bea28129..a181cc2b 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -148,6 +148,7 @@ static struct itemdef knowndef_table[] = { #ifdef USE_PAM PAMDEFS #endif + {NULL, NULL} }; #ifndef LOGINDEFS