Revision 8227746b95146c2921f83d2ae5f37ecd146592d8 authored by Elliot Saba on 21 October 2014, 20:18:59 UTC, committed by Elliot Saba on 21 October 2014, 22:05:51 UTC
1 parent 7b1eb64
Raw File
pcre-gcc49-compile.patch
diff -ur pcre-8.31.orig/pcre_compile.c pcre-8.31/pcre_compile.c
--- pcre-8.31.orig/pcre_compile.c	2012-06-20 21:08:50.000000000 +0600
+++ pcre-8.31/pcre_compile.c	2014-07-03 17:18:04.314881746 +0600
@@ -1292,11 +1292,15 @@
 /* Read the minimum value and do a paranoid check: a negative value indicates
 an integer overflow. */
 
-while (IS_DIGIT(*p)) min = min * 10 + *p++ - CHAR_0;
-if (min < 0 || min > 65535)
+while (IS_DIGIT(*p))
   {
-  *errorcodeptr = ERR5;
-  return p;
+  min = min * 10 + (int)(*p++ - CHAR_0);
+  if (min > 65535)
+    {
+    *errorcodeptr = ERR5;
+    while (*p != CHAR_RIGHT_CURLY_BRACKET) p++;
+    return p;
+    }
   }
 
 /* Read the maximum value if there is one, and again do a paranoid on its size.
@@ -1307,11 +1311,15 @@
   if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
     {
     max = 0;
-    while(IS_DIGIT(*p)) max = max * 10 + *p++ - CHAR_0;
-    if (max < 0 || max > 65535)
+    while(IS_DIGIT(*p))
       {
-      *errorcodeptr = ERR5;
-      return p;
+      max = max * 10 + (int)(*p++ - CHAR_0);
+      if (max > 65535)
+        {
+        *errorcodeptr = ERR5;
+        while (*p != CHAR_RIGHT_CURLY_BRACKET) p++;
+        return p;
+        }
       }
     if (max < min)
       {
back to top