hal/hald/linux linux_dvd_rw_utils.c,1.7,1.8

David Zeuthen david at freedesktop.org
Tue Sep 21 06:04:11 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv22096/hald/linux

Modified Files:
	linux_dvd_rw_utils.c 
Log Message:
2004-09-21  David Zeuthen  <david at fubar.dk>

	Patch from Martin Pitt <martin.pitt at canonical.com>
	
	* hald/linux/linux_dvd_rw_utils.c (get_read_write_speed): Several
	Ubuntu users reported that hal does not start up properly. I
	debugged this and found out that hald/linux/linux_dvd_rw_utils.c
	contains an unchecked buffer access which causes a segfault.  The
	attached patch fixes that; it might not be the most correct
	solution, but it works. The error is still present in 0.2.98; I
	made the fix in 0.2.92, but the patch should still apply.



Index: linux_dvd_rw_utils.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/linux_dvd_rw_utils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- linux_dvd_rw_utils.c	19 Sep 2004 14:08:10 -0000	1.7
+++ linux_dvd_rw_utils.c	21 Sep 2004 13:04:09 -0000	1.8
@@ -343,7 +343,10 @@
 		*write_speed = p[28] << 8 | p[29];
 	}
 
-	*read_speed = p[8] << 8 | p[9];
+	if (len >= hlen+9)
+	    *read_speed = p[8] << 8 | p[9];
+	else
+	    *read_speed = 0;
 
 	free (page2A);
 




More information about the hal-commit mailing list