From a831a20910408fc7472d89cf7fa10bd479445537 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 4 May 2024 09:40:51 -0700 Subject: [PATCH] unpackExtent detects corrupted compression method https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66338&q=label%3AProj-upx modified: p_unix.cpp --- src/p_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_unix.cpp b/src/p_unix.cpp index 86f9bc6a..5114b7aa 100644 --- a/src/p_unix.cpp +++ b/src/p_unix.cpp @@ -481,7 +481,7 @@ unsigned PackUnix::unpackExtent(unsigned wanted, OutputFile *fo, int const sz_cpr = ph.c_len = get_te32(&hdr.sz_cpr); ph.filter_cto = hdr.b_cto8; - if (sz_unc == 0) { // must never happen while 0!=wanted + if (sz_unc == 0 || M_LZMA < hdr.b_method) { throwCantUnpack("corrupt b_info"); break; }