]> granicus.if.org Git - shadow/commitdiff
Don't crash on bogus keys in login.defs if PAM is enabled
authorBernhard Rosenkränzer <bero@lindev.ch>
Thu, 26 Jan 2017 15:48:48 +0000 (16:48 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 29 Jan 2017 20:47:24 +0000 (14:47 -0600)
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 <bero@lindev.ch>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
lib/getdef.c

index bea28129b1b58b4128a3a198277d811759c7f7fa..a181cc2b9b8ba590716bd66a31c9bcbef9282484 100644 (file)
@@ -148,6 +148,7 @@ static struct itemdef knowndef_table[] = {
 #ifdef USE_PAM
        PAMDEFS
 #endif
+       {NULL, NULL}
 };
 
 #ifndef LOGINDEFS