From 4cd71da5603898cff68a31774be570750d7fd659 Mon Sep 17 00:00:00 2001 From: Matthias Schwarzott Date: Wed, 14 May 2008 16:03:49 +0200 Subject: [PATCH] cdrom_id: fix segfault --- extras/cdrom_id/cdrom_id.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c index 0e0a463d..e0cbe9e7 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]); -- 2.39.5