OBS-URL: https://build.opensuse.org/request/show/588647 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/zziplib?expand=0&rev=35
33 lines
1.2 KiB
Diff
33 lines
1.2 KiB
Diff
Index: zziplib-0.13.69/zzip/memdisk.c
|
|
===================================================================
|
|
--- zziplib-0.13.69.orig/zzip/memdisk.c
|
|
+++ zziplib-0.13.69/zzip/memdisk.c
|
|
@@ -222,6 +222,14 @@ zzip_mem_entry_new(ZZIP_DISK * disk, ZZI
|
|
item->zz_filetype = zzip_disk_entry_get_filetype(entry);
|
|
|
|
/*
|
|
+ * If zz_data+zz_csize exceeds the size of the file, bail out
|
|
+ */
|
|
+ if ((item->zz_data + item->zz_csize) < disk->buffer ||
|
|
+ (item->zz_data + item->zz_csize) >= disk->endbuf)
|
|
+ {
|
|
+ goto error;
|
|
+ }
|
|
+ /*
|
|
* If the file is uncompressed, zz_csize and zz_usize should be the same
|
|
* If they are not, we cannot guarantee that either is correct, so ...
|
|
*/
|
|
Index: zziplib-0.13.69/zzip/zip.c
|
|
===================================================================
|
|
--- zziplib-0.13.69.orig/zzip/zip.c
|
|
+++ zziplib-0.13.69/zzip/zip.c
|
|
@@ -408,7 +408,7 @@ __zzip_parse_root_directory(int fd,
|
|
struct _disk_trailer *trailer,
|
|
struct zzip_dir_hdr **hdr_return,
|
|
zzip_plugin_io_t io,
|
|
- zzip_off_t filesize);
|
|
+ zzip_off_t filesize)
|
|
{
|
|
auto struct zzip_disk_entry dirent;
|
|
struct zzip_dir_hdr *hdr;
|