diff options
author | Cedric BAIL <c.bail@partner.samsung.com> | 2014-07-14 15:59:06 +0200 |
---|---|---|
committer | Cedric BAIL <c.bail@partner.samsung.com> | 2014-07-14 16:05:35 +0200 |
commit | 31ff4aa86a3331160e34c582f3c2507d1c1a90b5 (patch) | |
tree | 7b70098cd35e2798fe74ba74c66f4d88b4bddac0 | |
parent | 0f92797b5ed43538ebbbfb9273ff77f2fa7aead2 (diff) |
lz4: fix another security issue on ARM 32bits.v1.10.2
-rw-r--r-- | src/static_libs/lz4/lz4.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/static_libs/lz4/lz4.c b/src/static_libs/lz4/lz4.c index a1475dc..482a8ed 100644 --- a/src/static_libs/lz4/lz4.c +++ b/src/static_libs/lz4/lz4.c | |||
@@ -922,7 +922,9 @@ FORCE_INLINE int LZ4_decompress_generic( | |||
922 | length += s; | 922 | length += s; |
923 | } | 923 | } |
924 | while (likely((endOnInput)?ip<iend-RUN_MASK:1) && (s==255)); | 924 | while (likely((endOnInput)?ip<iend-RUN_MASK:1) && (s==255)); |
925 | if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */ | 925 | //if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */ |
926 | if ((sizeof(void*)==4) && unlikely((size_t)(op+length)<(size_t)(op))) goto _output_error; /* quickfix issue 134 */ | ||
927 | if ((endOnInput) && (sizeof(void*)==4) && unlikely((size_t)(ip+length)<(size_t)(ip))) goto _output_error; /* quickfix issue 134 */ | ||
926 | } | 928 | } |
927 | 929 | ||
928 | /* copy literals */ | 930 | /* copy literals */ |
@@ -957,11 +959,12 @@ FORCE_INLINE int LZ4_decompress_generic( | |||
957 | unsigned s; | 959 | unsigned s; |
958 | do | 960 | do |
959 | { | 961 | { |
960 | if (endOnInput && (ip > iend-LASTLITERALS)) goto _output_error; | 962 | if ((endOnInput) && (ip > iend-LASTLITERALS)) goto _output_error; |
961 | s = *ip++; | 963 | s = *ip++; |
962 | length += s; | 964 | length += s; |
963 | } while (s==255); | 965 | } while (s==255); |
964 | if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */ | 966 | //if ((sizeof(void*)==4) && unlikely(length>LZ4_MAX_INPUT_SIZE)) goto _output_error; /* overflow detection */ |
967 | if ((sizeof(void*)==4) && unlikely((size_t)(op+length)<(size_t)op)) goto _output_error; /* quickfix issue 134 */ | ||
965 | } | 968 | } |
966 | 969 | ||
967 | /* check external dictionary */ | 970 | /* check external dictionary */ |