SHA256
3
0
forked from pool/shadow
shadow/shadow-passwd-handle-null.patch

22 lines
822 B
Diff
Raw Normal View History

Upstream commit: adb83f779618674e5e96e27e3d48559d62e2c410
To fix: https://github.com/shadow-maint/shadow/pull/398
Index: shadow-4.9/src/passwd.c
===================================================================
--- shadow-4.9.orig/src/passwd.c
+++ shadow-4.9/src/passwd.c
@@ -490,9 +490,12 @@ static void print_status (const struct p
((long long)sp->sp_max * SCALE) / DAY,
((long long)sp->sp_warn * SCALE) / DAY,
((long long)sp->sp_inact * SCALE) / DAY);
- } else {
+ } else if (NULL != pw->pw_passwd) {
(void) printf ("%s %s\n",
- pw->pw_name, pw_status (pw->pw_passwd));
+ pw->pw_name, pw_status (pw->pw_passwd));
+ } else {
+ (void) fprintf(stderr, _("%s: malformed password data obtained for user %s\n"),
+ Prog, pw->pw_name);
}
}