shadow-utils/shadow-4.9-pwck-fix-segfault-when-calling-fprintf.patch
Iker Pedrosa 4b31c38f8e - getsubids: provide system binary and man page
- useradd: generate home and mail directories with selinux user attribute
- useradd: revert fix memleak of grp
- groupdel: fix SIGSEGV when passwd does not exist
- pwck: fix segfault when calling fprintf()
- newgrp: fix segmentation fault
- Clean spec file: organize dependencies and move License location

Resolves: #2013015
Resolves: #1993081
Resolves: #2020238
Resolves: #2024834

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-12-02 13:25:52 +01:00

31 lines
885 B
Diff

From d8e54618feea201987c1f3cb402ed50d1d8b604f Mon Sep 17 00:00:00 2001
From: Iker Pedrosa <ipedrosa@redhat.com>
Date: Mon, 15 Nov 2021 12:40:15 +0100
Subject: [PATCH] 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 <ipedrosa@redhat.com>
---
src/pwck.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pwck.c b/src/pwck.c
index 4248944a..4ce86af2 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);
--
2.31.1