From: Matthias Schwarzott Date: Wed, 14 May 2008 14:03:49 +0000 (+0200) Subject: cdrom_id: fix segfault X-Git-Tag: 174~1702 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd71da5603898cff68a31774be570750d7fd659;p=systemd cdrom_id: fix segfault --- 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]);