From b84c710902564f1c818f7f85c3cdcf7d71aef856 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 16 May 2018 19:14:56 +1000 Subject: [PATCH] Prevent infinite loop in runzip_fd with crafted/damaged archive. --- runzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runzip.c b/runzip.c index 61ca2ef..667ae05 100644 --- a/runzip.c +++ b/runzip.c @@ -380,7 +380,7 @@ i64 runzip_fd(rzip_control *control, int fd_in, int fd_out, int fd_hist, i64 exp do { u = runzip_chunk(control, fd_in, expected_size, total); - if (unlikely(u == -1)) { + if (unlikely(u < 1)) { print_err("Failed to runzip_chunk in runzip_fd\n"); return -1; }