diff options
author | Cyan4973 <yann.collet.73@gmail.com> | 2014-07-02 21:32:23 (GMT) |
---|---|---|
committer | Cyan4973 <yann.collet.73@gmail.com> | 2014-07-02 21:32:23 (GMT) |
commit | 28fd251bc7b42e5cde15f9a2d78fc53b3b575558 (patch) | |
tree | eb91f6a2cd8d161d455565318bf9b8bbfbda0df9 /lz4.c | |
parent | 0665c503564a284b3ee71f955bb58bd19563e906 (diff) | |
parent | bdb5bcefff1c09592e2a85e38eac8e9c493ecef9 (diff) | |
download | lz4-28fd251bc7b42e5cde15f9a2d78fc53b3b575558.zip lz4-28fd251bc7b42e5cde15f9a2d78fc53b3b575558.tar.gz lz4-28fd251bc7b42e5cde15f9a2d78fc53b3b575558.tar.bz2 |
Merge pull request #11 from Cyan4973/devr119
Dev
Diffstat (limited to 'lz4.c')
-rw-r--r-- | lz4.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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((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 */ @@ -957,11 +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(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */ + if ((sizeof(void*)==4) && unlikely((size_t)(op+length)<(size_t)op)) goto _output_error; /* quickfix issue 134 */ } /* check external dictionary */ |