Blame SOURCES/shadow-4.9-pwck-fix-segfault-when-calling-fprintf.patch

2de3ab
From d8e54618feea201987c1f3cb402ed50d1d8b604f Mon Sep 17 00:00:00 2001
2de3ab
From: Iker Pedrosa <ipedrosa@redhat.com>
2de3ab
Date: Mon, 15 Nov 2021 12:40:15 +0100
2de3ab
Subject: [PATCH] pwck: fix segfault when calling fprintf()
2de3ab
2de3ab
As shadow_logfd variable is not set at the beginning of the program if
2de3ab
something fails and fprintf() is called a segmentation fault happens.
2de3ab
2de3ab
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2021339
2de3ab
2de3ab
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2de3ab
---
2de3ab
 src/pwck.c | 1 +
2de3ab
 1 file changed, 1 insertion(+)
2de3ab
2de3ab
diff --git a/src/pwck.c b/src/pwck.c
2de3ab
index 4248944a..4ce86af2 100644
2de3ab
--- a/src/pwck.c
2de3ab
+++ b/src/pwck.c
2de3ab
@@ -857,6 +857,7 @@ int main (int argc, char **argv)
2de3ab
 	 * Get my name so that I can use it to report errors.
2de3ab
 	 */
2de3ab
 	Prog = Basename (argv[0]);
2de3ab
+	shadow_logfd = stderr;
2de3ab
 
2de3ab
 	(void) setlocale (LC_ALL, "");
2de3ab
 	(void) bindtextdomain (PACKAGE, LOCALEDIR);
2de3ab
-- 
2de3ab
2.31.1
2de3ab