sigaction looks a.sa_handler even if act == NULL

Samuel Thibault samuel.thibault@ens-lyon.org
Sat Jul 21 21:11:00 GMT 2007


In __sigaction() in sysdeps/mach/hurd/sigaction.c, if act is NULL,
nothing is copied into a.  Later on at line 71, a.sa_handler is hence
used without having been defined.  The attached patch fixes this.

Samuel
-------------- next part --------------
2007-07-21  Samuel Thibault  <samuel.thibault@ens-lyon.org>

	* sysdeps/mach/hurd/sigaction.c (__sigaction): Check act != NULL before
	reading a.

Index: sysdeps/mach/hurd/sigaction.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/sigaction.c,v
retrieving revision 1.15
diff -u -p -r1.15 sigaction.c
--- sysdeps/mach/hurd/sigaction.c       3 Aug 2002 06:54:03 -0000       1.15
+++ sysdeps/mach/hurd/sigaction.c       10 Mar 2007 22:56:20 -0000
@@ -68,7 +68,7 @@ __sigaction (sig, act, oact)
       __spin_lock (&ss->lock);
       pending = ss->pending & ~ss->blocked;
     }
-  else if (a.sa_handler == SIG_IGN || a.sa_handler == SIG_DFL)
+  else if (act != NULL && (a.sa_handler == SIG_IGN || a.sa_handler == SIG_DFL))
     /* We are changing to an action that might be to ignore SIG signals.
        If SIG is blocked and pending and the new action is to ignore it, we
        must remove it from the pending set now; if the action is changed


More information about the Libc-alpha mailing list