From: Iker Pedrosa Date: Mon, 15 Nov 2021 11:40:15 +0000 (+0100) Subject: pwck: fix segfault when calling fprintf() X-Git-Tag: 4.10~22^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8e54618feea201987c1f3cb402ed50d1d8b604f;p=thirdparty%2Fshadow.git pwck: fix segfault when calling fprintf() As shadow_logfd variable is not set at the beginning of the program if something fails and fprintf() is called a segmentation fault happens. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2021339 Signed-off-by: Iker Pedrosa --- diff --git a/src/pwck.c b/src/pwck.c index 4248944ae..4ce86af29 100644 --- a/src/pwck.c +++ b/src/pwck.c @@ -857,6 +857,7 @@ int main (int argc, char **argv) * Get my name so that I can use it to report errors. */ Prog = Basename (argv[0]); + shadow_logfd = stderr; (void) setlocale (LC_ALL, ""); (void) bindtextdomain (PACKAGE, LOCALEDIR);