patch-2.4.9 linux/drivers/cdrom/cdrom.c

Next file: linux/drivers/char/ChangeLog
Previous file: linux/drivers/bluetooth/hci_usb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
@@ -2246,8 +2246,13 @@
 	if ((ret = cdo->generic_packet(cdi, &cgc)))
 		return ret;
 	
-	cgc.cmd[8] = cgc.buflen = be16_to_cpu(ti->track_information_length) +
+	cgc.buflen = be16_to_cpu(ti->track_information_length) +
 		     sizeof(ti->track_information_length);
+
+	if (cgc.buflen > sizeof(track_information))
+		cgc.buflen = sizeof(track_information);
+
+	cgc.cmd[8] = cgc.buflen;
 	return cdo->generic_packet(cdi, &cgc);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)