fix #666213 - uninitialized memory leading to killall -g name failure

This commit is contained in:
Jan Görig 2011-01-07 15:35:23 +01:00
parent f2fa38f6d3
commit 055dabaf4f
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/killall.c b/src/killall.c
index 8b590c2..2550fc1 100644
--- a/src/killall.c
+++ b/src/killall.c
@@ -331,7 +331,7 @@ kill_all (int signal, int names, char **namelist, struct passwd *pwent)
pgids = NULL; /* silence gcc */
else
{
- pgids = malloc (pids * sizeof (pid_t));
+ pgids = calloc (pids, sizeof (pid_t));
if (!pgids)
{
perror ("malloc");

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing processes on your system Summary: Utilities for managing processes on your system
Name: psmisc Name: psmisc
Version: 22.13 Version: 22.13
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/System Group: Applications/System
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@ -15,6 +15,7 @@ BuildRequires: autoconf automake
Patch1: psmisc-22.13-peekfd-segv.patch Patch1: psmisc-22.13-peekfd-segv.patch
Patch2: psmisc-22.13-fuser-silent.patch Patch2: psmisc-22.13-fuser-silent.patch
Patch3: psmisc-22.13-killall-pgid.patch
%description %description
The psmisc package contains utilities for managing processes on your The psmisc package contains utilities for managing processes on your
@ -29,6 +30,7 @@ of processes that are using specified files or filesystems.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%build %build
%configure --prefix=%{_prefix} --enable-selinux %configure --prefix=%{_prefix} --enable-selinux
@ -63,6 +65,9 @@ rm -rf $RPM_BUILD_ROOT
%doc AUTHORS ChangeLog COPYING README %doc AUTHORS ChangeLog COPYING README
%changelog %changelog
* Fri Jan 7 2011 Jan Görig <jgorig@redhat.com> 22.13-6
- fix #666213 - uninitialized memory leading to `killall -g name` failure
* Tue Nov 16 2010 Jan Görig <jgorig@redhat.com> 22.13-5 * Tue Nov 16 2010 Jan Görig <jgorig@redhat.com> 22.13-5
- fix #651794 - incorrect exit code of fuser -m -s - fix #651794 - incorrect exit code of fuser -m -s