summaryrefslogtreecommitdiff
path: root/extras/cdrom_id/cdrom_id.c
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2008-05-14 16:03:49 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-05-14 16:03:49 +0200
commit4cd71da5603898cff68a31774be570750d7fd659 (patch)
treea6e4a61607ef0278d3b47906e1223bf33464b982 /extras/cdrom_id/cdrom_id.c
parent788096cb59a7ad1cdd08ccc59e5e3b1d2f4828c2 (diff)
cdrom_id: fix segfault
Diffstat (limited to 'extras/cdrom_id/cdrom_id.c')
-rw-r--r--extras/cdrom_id/cdrom_id.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 0e0a463d94..e0cbe9e713 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -469,6 +469,8 @@ static int cd_media_toc(int fd)
info("READ TOC: len: %d\n", len);
if (len > sizeof(toc))
return -1;
+ if (len < 8)
+ return -1;
/* check if we have a data track */
info("ctl %02x (0x04 is data/audio)\n", header[5]);