rpms/libraw1394/F-9 libraw1394-memset-and-patch-up-leaks.patch, NONE, 1.1 libraw1394.spec, 1.41, 1.42

Jarod Wilson (jwilson) fedora-extras-commits at redhat.com
Tue Jun 17 15:27:03 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/libraw1394/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31825

Modified Files:
	libraw1394.spec 
Added Files:
	libraw1394-memset-and-patch-up-leaks.patch 
Log Message:
* Tue Jun 17 2008 Jarod Wilson <jwilson at redhat.com> - 1.3.0-7
- Fully initialize data structures and plug dir leak. Resolves
  crashes when used with kino (Philippe Troin, #451727)


libraw1394-memset-and-patch-up-leaks.patch:

--- NEW FILE libraw1394-memset-and-patch-up-leaks.patch ---
diff -ru libraw1394-1.3.0.orig/juju/raw1394-iso.c libraw1394-1.3.0/juju/raw1394-iso.c
--- libraw1394-1.3.0.orig/juju/raw1394-iso.c	2008-06-13 13:16:05.000000000 -0700
+++ libraw1394-1.3.0/juju/raw1394-iso.c	2008-06-13 12:59:11.000000000 -0700
@@ -395,6 +395,7 @@
 	}
 
 	handle->iso.closure.func = handle_iso_event;
+	memset(&ep, 0, sizeof(ep));
 	ep.events = EPOLLIN;
 	ep.data.ptr = &handle->iso.closure;
 	if (epoll_ctl(handle->epoll_fd, EPOLL_CTL_ADD,
@@ -405,6 +406,7 @@
 		return -1;
 	}
 
+	memset(&create, 0, sizeof(create));
 	create.type = type;
 	create.channel = channel;
 	create.speed = speed;
diff -ru libraw1394-1.3.0.orig/juju/raw1394.c libraw1394-1.3.0/juju/raw1394.c
--- libraw1394-1.3.0.orig/juju/raw1394.c	2008-06-13 13:16:05.000000000 -0700
+++ libraw1394-1.3.0/juju/raw1394.c	2008-06-13 12:41:55.000000000 -0700
@@ -154,6 +154,8 @@
 		fd = open(filename, O_RDWR);
 		if (fd < 0)
 			continue;
+		memset(&get_info, 0, sizeof(get_info));
+		memset(&reset, 0, sizeof(reset));
 		get_info.version = FW_CDEV_VERSION;
 		get_info.rom = 0;
 		get_info.rom_length = 0;
@@ -407,7 +409,10 @@
 	struct epoll_event ep;
 	int i;
 
+	memset(&ep, 0, sizeof(ep));
+
 	handle = malloc(sizeof *handle);
+	memset(handle, 0, sizeof(*handle));
 
 	handle->tag_handler = default_tag_handler;
 	handle->arm_tag_handler = default_arm_tag_handler;
@@ -593,6 +598,8 @@
 		if (fd < 0)
 			continue;
 
+		memset(&get_info, 0, sizeof(get_info));
+		memset(&reset, 0, sizeof(reset));
 		get_info.version = FW_CDEV_VERSION;
 		get_info.rom = 0;
 		get_info.rom_length = 0;
@@ -616,10 +623,12 @@
 			sizeof handle->devices[i].filename);
 
 		handle->devices[i].closure.func = handle_device_event;
+		memset(&ep, 0, sizeof(ep));
 		ep.events = EPOLLIN;
 		ep.data.ptr = &handle->devices[i].closure;
 		if (epoll_ctl(handle->epoll_fd, EPOLL_CTL_ADD, fd, &ep) < 0) {
 			close(fd);
+			closedir(dir);
 			return -1;
 		}
 
@@ -634,6 +643,7 @@
 		i++;
 	}
 
+	closedir(dir);
 	return 0;
 }
 
@@ -1286,6 +1296,7 @@
 
 	closure->callback = handle_fcp_request;
 
+	memset(&request, 0, sizeof(request));
 	request.offset = CSR_REGISTER_BASE + CSR_FCP_COMMAND;
 	request.length = CSR_FCP_END - CSR_FCP_COMMAND;
 	request.closure = ptr_to_u64(closure);
@@ -1328,6 +1339,7 @@
 	struct fw_cdev_get_info get_info;
 	int err;
 
+	memset(&get_info, 0, sizeof(get_info));
 	get_info.version = FW_CDEV_VERSION;
 	get_info.rom = ptr_to_u64(buffer);
 	get_info.rom_length = buffersize;
diff -ru libraw1394-1.3.0.orig/tools/testlibraw.c libraw1394-1.3.0/tools/testlibraw.c
--- libraw1394-1.3.0.orig/tools/testlibraw.c	2008-06-13 13:16:05.000000000 -0700
+++ libraw1394-1.3.0/tools/testlibraw.c	2008-06-13 12:24:54.000000000 -0700
@@ -202,6 +202,7 @@
 	read_topology_map(handle);
 
         printf("testing config rom stuff\n");
+	memset(rom, 0, sizeof(rom));
         retval=raw1394_get_config_rom(handle, rom, 0x100, &rom_size, &rom_version);
         printf("get_config_rom returned %d, romsize %d, rom_version %d\n",retval,rom_size,rom_version);
         printf("here are the first 10 quadlets:\n");


Index: libraw1394.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libraw1394/F-9/libraw1394.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- libraw1394.spec	28 Apr 2008 19:14:55 -0000	1.41
+++ libraw1394.spec	17 Jun 2008 15:26:14 -0000	1.42
@@ -1,7 +1,7 @@
 Summary:        Library providing low-level IEEE-1394 access
 Name:           libraw1394
 Version:        1.3.0
-Release:        6%{?dist}
+Release:        7%{?dist}
 License:        LGPLv2+
 Group:          System Environment/Libraries
 Source:         http://www.linux1394.org/dl/libraw1394-%{version}.tar.gz
@@ -14,6 +14,7 @@
 Patch1:         libraw1394-juju-no-double-free-on-shutdown.patch
 Patch2:         libraw1394-juju-bitfield-update.patch
 Patch3:         libraw1394-juju-munmap-correct-max_packet_size.patch
+Patch4:         libraw1394-memset-and-patch-up-leaks.patch
 
 %description
 The libraw1394 library provides direct access to the IEEE-1394 bus through
@@ -34,6 +35,7 @@
 %patch1 -p1 -b .free
 %patch2 -p1 -b .bitf
 %patch3 -p1 -b .munmap
+%patch4 -p1 -b .memset
 
 %build
 aclocal
@@ -76,6 +78,10 @@
 
 
 %changelog
+* Tue Jun 17 2008 Jarod Wilson <jwilson at redhat.com> - 1.3.0-7
+- Fully initialize data structures and plug dir leak. Resolves
+  crashes when used with kino (Philippe Troin, #451727)
+
 * Mon Apr 28 2008 Jarod Wilson <jwilson at redhat.com> - 1.3.0-6
 - Unmap the correct memory range on iso receive teardown, fixes
   segfault on exit from dvgrab (Mladen Kuntner, #444354)




More information about the fedora-extras-commits mailing list