summaryrefslogtreecommitdiffstats
path: root/lz4.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-07-02 17:02:29 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-07-02 17:02:29 (GMT)
commit3a9427237dae41c0abd0a07d8ac862cbb9a037c3 (patch)
tree36233126531e1276443c53fc9fb5388198965ab1 /lz4.c
parenta3089e5b291a1aa946cbeb370f53b2b565146b3b (diff)
downloadlz4-3a9427237dae41c0abd0a07d8ac862cbb9a037c3.zip
lz4-3a9427237dae41c0abd0a07d8ac862cbb9a037c3.tar.gz
lz4-3a9427237dae41c0abd0a07d8ac862cbb9a037c3.tar.bz2
Stronger fuzzer tests
Stronger fix 134
Diffstat (limited to 'lz4.c')
-rw-r--r--lz4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lz4.c b/lz4.c
index c0b6c1a..482a8ed 100644
--- a/lz4.c
+++ b/lz4.c
@@ -923,8 +923,8 @@ FORCE_INLINE int LZ4_decompress_generic(
}
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(op+length<op)) goto _output_error; /* quickfix issue 134 */
- if (endOnInput && (sizeof(void*)==4) && unlikely(ip+length<ip)) goto _output_error; /* quickfix issue 134 */
+ if ((sizeof(void*)==4) && unlikely((size_t)(op+length)<(size_t)(op))) goto _output_error; /* quickfix issue 134 */
+ if ((endOnInput) && (sizeof(void*)==4) && unlikely((size_t)(ip+length)<(size_t)(ip))) goto _output_error; /* quickfix issue 134 */
}
/* copy literals */
@@ -959,12 +959,12 @@ FORCE_INLINE int LZ4_decompress_generic(
unsigned s;
do
{
- if (endOnInput && (ip > iend-LASTLITERALS)) goto _output_error;
+ if ((endOnInput) && (ip > iend-LASTLITERALS)) goto _output_error;
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(op+length<op)) goto _output_error; /* quickfix issue 134 */
+ if ((sizeof(void*)==4) && unlikely((size_t)(op+length)<(size_t)op)) goto _output_error; /* quickfix issue 134 */
}
/* check external dictionary */