]> granicus.if.org Git - zziplib/commitdiff
Merge pull request #19 from jmoellers/master
authorGuido U. Draheim <guidod@gmx.de>
Tue, 6 Feb 2018 16:22:34 +0000 (17:22 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Feb 2018 16:22:34 +0000 (17:22 +0100)
Make sure an extension block is large enough.

1  2 
zzip/memdisk.c
zzip/mmapped.c

diff --cc zzip/memdisk.c
Simple merge
diff --cc zzip/mmapped.c
index c61fc5656b69955f76f4feed662c0df9416f271b,d66c4dad195cc67658723f63cc01cdba88ff44bc..537be26fd05a566eaffb88132ad29ad4de22b1e3
@@@ -458,9 -458,15 +458,15 @@@ zzip_disk_findfirst(ZZIP_DISK * disk
              errno = EBADMSG;
              return 0;
          }
+       if (root >= disk->endbuf)
+       {
+           DBG1("root behind endbuf should be impossible");
+           errno = EBADMSG;
+           return 0;
+       }
          if (zzip_disk_entry_check_magic(root))
          {
 -            DBG1("found the disk root");
 +            DBG2("found the disk root %p", root);
              return (struct zzip_disk_entry *) root;
          }
      } ____;