1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
--- a/src/libpst.c 2021-03-28 11:08:05.000000000 +1100
+++ b/src/libpst.c 2025-03-09 23:39:04.397180838 +1100
@@ -3828,9 +3828,9 @@ static size_t pst_read_block_size(pst_fi
return -1;
}
*buf = (char *) pst_malloc(inflated_size);
- size_t result_size = inflated_size;
- if (uncompress((Bytef *) *buf, &result_size, (Bytef *) zbuf, size) != Z_OK || result_size != inflated_size) {
- DEBUG_WARN(("Failed to uncompress %i bytes to %i bytes, got %i\n", size, inflated_size, result_size));
+ uLongf result_size = inflated_size;
+ if (uncompress((Bytef *) *buf, &result_size, (Bytef *) zbuf, size) != Z_OK || ((size_t) result_size) != inflated_size) {
+ DEBUG_WARN(("Failed to uncompress %i bytes to %i bytes, got %i\n", size, inflated_size, (size_t) result_size));
if (zbuf) free(zbuf);
DEBUG_RET();
return -1;
|