:: commit e17c8daf5b87d63a1aba376cae80718372d3fbda

Kamila Szewczyk <kspalaiologos@gmail.com> — 2023-03-22 13:38

parents: 33b1951f15

bz3_bound in bz3_decompress

diff --git a/src/libbz3.c b/src/libbz3.c
index 31e11bf..2b1ba25 100644
--- a/src/libbz3.c
+++ b/src/libbz3.c
@@ -858,7 +858,7 @@ BZIP3_API int bz3_decompress(const uint8_t * in, uint8_t * out, size_t in_size,
     struct bz3_state * state = bz3_new(block_size);
     if (!state) return BZ3_ERR_INIT;
 
-    u8 * compression_buf = malloc(block_size);
+    u8 * compression_buf = malloc(bz3_bound(block_size));
     if (!compression_buf) {
         bz3_free(state);
         return BZ3_ERR_INIT;
tab: 248 wrap: offon