From: Roy Marples Date: Sat, 10 Nov 2012 17:55:37 +0000 (+0000) Subject: Fix memory errors X-Git-Tag: v5.99.3~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84eb756f3e7217759c950a4a148fc7950d289ef7;p=thirdparty%2Fdhcpcd.git Fix memory errors --- diff --git a/compat/posix_spawn.c b/compat/posix_spawn.c index 1e07f3b6..3de3f301 100644 --- a/compat/posix_spawn.c +++ b/compat/posix_spawn.c @@ -63,7 +63,7 @@ posix_spawnattr_handle(const posix_spawnattr_t *attrp) sigprocmask(SIG_SETMASK, &attrp->posix_attr_sigmask, NULL); if (attrp->posix_attr_flags & POSIX_SPAWN_SETSIGDEF) { - sa.sa_flags = 0; + memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_DFL; for (i = 1; i < _NSIG; i++) { if (sigismember(&attrp->posix_attr_sigdefault, i)) { diff --git a/signals.c b/signals.c index e1ce69cb..3602fae8 100644 --- a/signals.c +++ b/signals.c @@ -55,6 +55,9 @@ signal_handle(void (*func)(int), sigset_t *oldset) sa.sa_handler = func; sigemptyset(&sa.sa_mask); + if (oldset) + sigemptyset(&newset); + for (i = 0; handle_sigs[i]; i++) { if (sigaction(handle_sigs[i], &sa, NULL) == -1) return -1;