]> granicus.if.org Git - zziplib/commitdiff
collaps conditions
authorGuido Draheim <guidod@gmx.de>
Fri, 23 Mar 2018 22:33:09 +0000 (23:33 +0100)
committerGuido Draheim <guidod@gmx.de>
Fri, 23 Mar 2018 22:33:09 +0000 (23:33 +0100)
zzip/zip.c

index dd0a2e788c4147eb012c615f651637dae55c4d00..b77d50a2489a6f5cdec49cec9038fb5408f35eb1 100644 (file)
@@ -423,10 +423,8 @@ __zzip_parse_root_directory(int fd,
     zzip_off64_t zz_rootseek = _disk_trailer_rootseek(trailer);
     __correct_rootseek(zz_rootseek, zz_rootsize, trailer);
 
-    if (zz_rootsize <= 0 || zz_rootseek < 0 || zz_rootseek >= filesize)
-       return ZZIP_CORRUPTED;
-
-    if (zz_entries < 0 || zz_rootseek < 0 || zz_rootsize < 0)
+    if (zz_entries <= 0 || zz_rootsize < 0 ||
+        zz_rootseek < 0 || zz_rootseek >= filesize)
         return ZZIP_CORRUPTED;
 
     hdr0 = (struct zzip_dir_hdr *) malloc(zz_rootsize);