]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - lib/decompress_unlzma.c
Decompressors: fix header validation in decompress_unlzma.c
[karo-tx-linux.git] / lib / decompress_unlzma.c
index 48173594ce01400d2fca2d61423e94f4edf5fb6e..696c34a274cf2df7eec8b7a175a9c886e11b882b 100644 (file)
@@ -574,8 +574,10 @@ STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
                ((unsigned char *)&header)[i] = *rc.ptr++;
        }
 
-       if (header.pos >= (9 * 5 * 5))
+       if (header.pos >= (9 * 5 * 5)) {
                error("bad header");
+               goto exit_1;
+       }
 
        mi = 0;
        lc = header.pos;