cedric pushed a commit to branch efl-1.9.

http://git.enlightenment.org/core/efl.git/commit/?id=60c3dd385cd88ac41754e30fafc3ab3bdcb30907

commit 60c3dd385cd88ac41754e30fafc3ab3bdcb30907
Author: Cedric BAIL <[email protected]>
Date:   Mon Jul 14 15:59:06 2014 +0200

    lz4: fix another security issue on ARM 32bits.
---
 src/static_libs/lz4/lz4.c | 9 ++++++---
 1 file 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(
                 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 */

-- 


Reply via email to