linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH, UDEV] fix initialization of struct sigaction
@ 2005-02-05 14:47 Michael Buesch
  2005-02-05 15:23 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Buesch @ 2005-02-05 14:47 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 747 bytes --]

Hi,

This fixes the initialization of
struct sigaction act;
Valgrind complains about this as follows:

==4304== Syscall param sigaction(act) contains uninitialised or unaddressable byte(s)
==4304==    at 0x804A37B: (within /sbin/udevd)
==4304==  Address 0x52BFE7FC is on thread 1's stack

-- 
Regards Michael Buesch  [ http://www.tuxsoft.de.vu ]


===== udevd.c 1.64 vs edited =====
--- 1.64/udevd.c	2005-01-16 16:53:07 +01:00
+++ edited/udevd.c	2005-02-05 15:42:39 +01:00
@@ -690,6 +690,7 @@
 		dbg("error fcntl on write pipe: %s", strerror(errno));
 
 	/* set signal handlers */
+	memset(&act, 0x00, sizeof(act));
 	act.sa_handler = (void (*) (int))sig_handler;
 	sigemptyset(&act.sa_mask);
 	act.sa_flags = SA_RESTART;

[-- Attachment #1.2: udevd_sigaction_init_fix.diff --]
[-- Type: text/x-diff, Size: 385 bytes --]

===== udevd.c 1.64 vs edited =====
--- 1.64/udevd.c	2005-01-16 16:53:07 +01:00
+++ edited/udevd.c	2005-02-05 15:42:39 +01:00
@@ -690,6 +690,7 @@
 		dbg("error fcntl on write pipe: %s", strerror(errno));
 
 	/* set signal handlers */
+	memset(&act, 0x00, sizeof(act));
 	act.sa_handler = (void (*) (int))sig_handler;
 	sigemptyset(&act.sa_mask);
 	act.sa_flags = SA_RESTART;

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-05 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-05 14:47 [PATCH, UDEV] fix initialization of struct sigaction Michael Buesch
2005-02-05 15:23 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).