This reverts commit 867177e3e4a220e0e59fa1af136f5c06800f1fa7.
Reverting in order to apply the upstream libmspack version of the fix for the same bug.
... | ... |
@@ -626,7 +626,7 @@ static unsigned char *read_chunk(struct mschm_decompressor_p *self, |
626 | 626 |
|
627 | 627 |
/* ensure chunk cache is available */ |
628 | 628 |
if (!chm->chunk_cache) { |
629 |
- size_t size = sizeof(unsigned char *) * (chm->num_chunks + 1); |
|
629 |
+ size_t size = sizeof(unsigned char *) * chm->num_chunks; |
|
630 | 630 |
if (!(chm->chunk_cache = (unsigned char **) sys->alloc(sys, size))) { |
631 | 631 |
self->error = MSPACK_ERR_NOMEMORY; |
632 | 632 |
return NULL; |