summaryrefslogtreecommitdiffstats
path: root/lz4.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-07-02 03:36:56 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-07-02 03:36:56 (GMT)
commit1411c2b6740b92cbe258465a20f43e8de6098a8f (patch)
tree88e6469c3f174452257e91f415e180851a2103af /lz4.c
parent93e589caad5503326bec3a4085ec797940eed94d (diff)
downloadlz4-1411c2b6740b92cbe258465a20f43e8de6098a8f.zip
lz4-1411c2b6740b92cbe258465a20f43e8de6098a8f.tar.gz
lz4-1411c2b6740b92cbe258465a20f43e8de6098a8f.tar.bz2
Quickfix of issue 134 (untested)
Diffstat (limited to 'lz4.c')
-rw-r--r--lz4.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lz4.c b/lz4.c
index a1475dc..c0b6c1a 100644
--- a/lz4.c
+++ b/lz4.c
@@ -922,7 +922,9 @@ FORCE_INLINE int LZ4_decompress_generic(
length += s;
}
while (likely((endOnInput)?ip<iend-RUN_MASK:1) && (s==255));
- if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */
+ //if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */
+ if ((sizeof(void*)==4) && unlikely(op+length<op)) goto _output_error; /* quickfix issue 134 */
+ if (endOnInput && (sizeof(void*)==4) && unlikely(ip+length<ip)) goto _output_error; /* quickfix issue 134 */
}
/* copy literals */
@@ -961,7 +963,8 @@ FORCE_INLINE int LZ4_decompress_generic(
s = *ip++;
length += s;
} while (s==255);
- if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */
+ //if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */
+ if ((sizeof(void*)==4) && unlikely(op+length<op)) goto _output_error; /* quickfix issue 134 */
}
/* check external dictionary */