[PATCH] libc: fix signal handling in system()

Mike Frysinger vapier at gentoo.org
Tue Jan 17 03:52:58 UTC 2012


On Monday 16 January 2012 04:54:52 Richard Braun wrote:
> --- a/libc/stdlib/system.c
> +++ b/libc/stdlib/system.c
> 
> +	sa.sa_handler = SIG_IGN;
> +	sigemptyset(&sa.sa_mask);
> +	sa.sa_flags = 0;

this leaves the other fields of sigaction uninitialized.  i think we need:

 	if (command == 0)
 		return 1;
 
+	memset(&sa, 0, sizeof(sa));
 	sa.sa_handler = SIG_IGN;
 	sigemptyset(&sa.sa_mask);
-	sa.sa_flags = 0;
 	sigaction(SIGQUIT, &sa, &save_quit);
 	sigaction(SIGINT, &sa, &save_int);
 	sigaddset(&sa.sa_mask, SIGCHLD);

otherwise, if people don't have any feedback on things, i'll push the latest 
version
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20120116/7e197c56/attachment.asc>


More information about the uClibc mailing list