From f0aef9b28bffd92b697748b8b82ed927f0c0b8a0 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Fri, 8 May 2015 17:04:16 -0700 Subject: [PATCH] Check input data; CERT-FI upx-crashes-elf id:000000,sig:11,src:000000,op:flip1,pos:0 --- src/filter/ctojr.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/filter/ctojr.h b/src/filter/ctojr.h index 4c74ea4b..1d27c3f1 100644 --- a/src/filter/ctojr.h +++ b/src/filter/ctojr.h @@ -300,6 +300,9 @@ static int U(Filter *f) } else { // not 1st time at this destination jc >>= 1; + if (N_MRU <= jc) { + throwCompressedDataViolation(); + } int kh = jc + hand; if (N_MRU <= kh) { kh -= N_MRU;