linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix cdrom profile enumeration.
@ 2010-04-14  3:07 mike
  2010-04-15  1:38 ` mike
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mike @ 2010-04-14  3:07 UTC (permalink / raw)
  To: linux-hotplug

From: Mike Brudevold <mike@brudevold.com>

---
 extras/cdrom_id/cdrom_id.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index b6797cd..28b1bfe 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -261,6 +261,7 @@ static int cd_profiles(struct udev *udev, int fd)
 	struct scsi_cmd sc;
 	unsigned char header[8];
 	unsigned char profiles[512];
+	unsigned int profiles_end;
 	unsigned int cur_profile;
 	unsigned int len;
 	unsigned int i;
@@ -298,7 +299,8 @@ static int cd_profiles(struct udev *udev, int fd)
 	}
 
 	/* device profiles */
-	for (i = 12; i < profiles[11]; i += 4) {
+	profiles_end = 12 + profiles[11];
+	for (i = 12; i < profiles_end; i += 4) {
 		unsigned int profile = (profiles[i] << 8 | profiles[i + 1]);
 		if (profile = 0)
 			continue;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-16 23:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14  3:07 [PATCH] Fix cdrom profile enumeration mike
2010-04-15  1:38 ` mike
2010-04-15  6:43 ` Martin Pitt
2010-04-15 13:42 ` Mike Brudevold
2010-04-15 18:15 ` Kay Sievers
2010-04-16  1:03 ` Mike Brudevold
2010-04-16  5:45 ` Kay Sievers
2010-04-16 23:05 ` Mike Brudevold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).