summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ideviceinstaller.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index 3780979..00a25de 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -163,7 +163,7 @@ static int zip_f_get_contents(struct zip *zf, const char *filename, int locate_f
}
*buffer = malloc(zs.size);
- if (zip_fread(zfile, *buffer, zs.size) != zs.size) {
+ if (zs.size > LLONG_MAX || zip_fread(zfile, *buffer, zs.size) != (zip_int64_t)zs.size) {
fprintf(stderr, "ERROR: zip_fread %" PRIu64 " bytes from '%s'\n", (uint64_t)zs.size, filename);
free(*buffer);
*buffer = NULL;