linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mbuesch@freenet.de>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH, UDEV] fix initialization of struct sigaction
Date: Sat, 05 Feb 2005 14:47:21 +0000	[thread overview]
Message-ID: <200502051547.27583.mbuesch@freenet.de> (raw)


[-- 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 --]

             reply	other threads:[~2005-02-05 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-05 14:47 Michael Buesch [this message]
2005-02-05 15:23 ` [PATCH, UDEV] fix initialization of struct sigaction Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502051547.27583.mbuesch@freenet.de \
    --to=mbuesch@freenet.de \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).