]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add sanity check.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 13 Oct 2009 18:56:31 +0000 (14:56 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 13 Oct 2009 18:56:31 +0000 (14:56 -0400)
SVN-Revision: 1514

libarchive/archive_read_support_format_iso9660.c

index 4bab50b94e64c2788d458746f50deaa3b416de94..5ee0e6984ac2c9ab27975889ceddaee3769978cb 100644 (file)
@@ -1307,7 +1307,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
                return (NULL);
        }
        /* Sanity check that name_len doesn't exceed dr_len. */
-       if (dr_len - 33 < name_len) {
+       if (dr_len - 33 < name_len || name_len == 0) {
                archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
                    "Invalid length of file identifier");
                return (NULL);