]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix my silly bug; I didn't consider that a uncompressed file
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 6 Sep 2009 01:36:23 +0000 (21:36 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 6 Sep 2009 01:36:23 +0000 (21:36 -0400)
size was just 1 << log2_bs.

SVN-Revision: 1426

libarchive/archive_read_support_format_iso9660.c

index 57f51793e899383dabf00d36bc2f7fd91db9b2ef..287e15d82392d9c4a0bcf3916f354d68cd5bf9f0 100644 (file)
@@ -763,8 +763,10 @@ zisofs_read_data(struct archive_read *a,
                size_t ceil, xsize;
 
                /* Allocate block pointers buffer. */
-               ceil = zisofs->pz_uncompressed_size >> zisofs->pz_log2_bs;
-               xsize = (ceil + 1 + 1) * 4;
+               ceil = (zisofs->pz_uncompressed_size +
+                       (1UL << zisofs->pz_log2_bs) - 1)
+                       >> zisofs->pz_log2_bs;
+               xsize = (ceil + 1) * 4;
                if (zisofs->block_pointers_alloc < xsize) {
                        size_t alloc;