]> err.no Git - systemd/commitdiff
cdrom_id: fix segfault
authorMatthias Schwarzott <zzam@gentoo.org>
Wed, 14 May 2008 14:03:49 +0000 (16:03 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 14 May 2008 14:03:49 +0000 (16:03 +0200)
extras/cdrom_id/cdrom_id.c

index 0e0a463d94856bd583a6ecc9bb945033d6aae46b..e0cbe9e71321d3e5640067a01f22941971129074 100644 (file)
@@ -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]);