rpms/sysvinit/devel sysvinit-2.86-utmpdump.patch, NONE, 1.1 sysvinit.spec, 1.70, 1.71

Bill Nottingham notting at fedoraproject.org
Mon Dec 8 20:44:28 UTC 2008


Author: notting

Update of /cvs/extras/rpms/sysvinit/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25071

Modified Files:
	sysvinit.spec 
Added Files:
	sysvinit-2.86-utmpdump.patch 
Log Message:
Fix one 'return value unchecked' that could reasonably cause trouble and can
be handled sanely (mainly because it leaks.) (#473485)


sysvinit-2.86-utmpdump.patch:

--- NEW FILE sysvinit-2.86-utmpdump.patch ---
diff -ru sysvinit-2.86/src/utmpdump.c sysvinit-2.86.foo/src/utmpdump.c
--- sysvinit-2.86/src/utmpdump.c	2000-09-12 16:14:24.000000000 -0500
+++ sysvinit-2.86.foo/src/utmpdump.c	2008-12-08 15:37:51.000000000 -0500
@@ -81,18 +81,20 @@
 time_t
 strtotime(const char *s_time)
 {
-	struct tm *tm = malloc(sizeof(*tm));
+	struct tm tm;
+	
+	memset(&tm, '\0', sizeof(struct tm));
 
 	if (s_time[0] == ' ' || s_time[0] == '\0')
 		return (time_t)0;
 
-	strptime(s_time, "%a %b %d %T %Y", tm);
+	strptime(s_time, "%a %b %d %T %Y", &tm);
 
 	/* Cheesy way of checking for DST */
 	if (s_time[26] == 'D')
-		tm->tm_isdst = 1;
+		tm.tm_isdst = 1;
 
-	return mktime(tm);
+	return mktime(&tm);
 }
 
 #define cleanse(x) xcleanse(x, sizeof(x))


Index: sysvinit.spec
===================================================================
RCS file: /cvs/extras/rpms/sysvinit/devel/sysvinit.spec,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- sysvinit.spec	8 Dec 2008 20:14:54 -0000	1.70
+++ sysvinit.spec	8 Dec 2008 20:43:57 -0000	1.71
@@ -1,7 +1,7 @@
 Summary: Programs which control basic system processes
 Name: sysvinit
 Version: 2.86
-Release: 25
+Release: 26
 License: GPLv2+
 Group: System Environment/Base
 Source: ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-%{version}.tar.gz
@@ -29,6 +29,7 @@
 Patch21: sysvinit-no-abort.patch
 Patch22: 81_killall_avoid_init.dpatch
 Patch23: sysvinit-2.86-pidof-man.patch
+Patch24: sysvinit-2.86-utmpdump.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: pam >= 0.66-5
 Requires: filesystem >= 2.2.4-1
@@ -104,6 +105,8 @@
 %patch22 -p1 -b .nopid1
 # Document some of the behavior of pidof. (#201317)
 %patch23 -p1 -b .pidof
+# Don't pass around unchecked malloc (and avoid a leak) (#473485)
+%patch24 -p1 -b .wheee
 
 %build
 make %{?_smp_mflags} CC="%{__cc}" CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" -C src
@@ -175,6 +178,7 @@
 %changelog
 * Mon Dec  8 2088 Bill Nottingham <notting at redhat.com> - 2.86-26
 - document readlink() behavior in pidof (#201317)
+- fix potential issue in utmpdmp (#473485)
 
 * Wed Oct  1 2008 Bill Nottingham <notting at redhat.com> - 2.86-25
 - rediff patches (#464940)




More information about the fedora-extras-commits mailing list