]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: fix caught_signal logic and initialize oldact [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 2 Oct 2013 12:43:17 +0000 (14:43 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Oct 2013 12:43:17 +0000 (14:43 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index 858af0176ff6b8f82adadec6494e89391fecb390..7f1b505bfc2b7df7affd17c251ce5d9fa2b12d25 100644 (file)
@@ -288,6 +288,8 @@ create_watching_parent (void)
   else
     _pam_session_opened = 1;
 
+  memset(oldact, 0, sizeof(oldact));
+
   child = fork ();
   if (child == (pid_t) -1)
     {
@@ -408,6 +410,9 @@ create_watching_parent (void)
           sigaction(SIGQUIT, &oldact[2], NULL);
           break;
         default:
+         /* just in case that signal stuff initialization failed and
+          * caught_signal = true */
+          caught_signal = SIGKILL;
           break;
       }
       kill(0, caught_signal);