]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - lib/decompress_unlzma.c
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mv-sheeva.git] / lib / decompress_unlzma.c
index f30c899241ef2d7e869194c08cc58765a684b4ba..476c65af97098bb0e117999a645fe9c03192ceb5 100644 (file)
@@ -522,6 +522,9 @@ static inline int INIT process_bit1(struct writer *wr, struct rc *rc,
                        cst->rep0 = pos_slot;
                if (++(cst->rep0) == 0)
                        return 0;
+               if (cst->rep0 > wr->header->dict_size
+                               || cst->rep0 > get_pos(wr))
+                       return -1;
        }
 
        len += LZMA_MATCH_MIN_LEN;