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

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