X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=pcre%2Fpcre.c;h=4f8f82cd4ec6b7ef1a89cf3ce673bff719a77a16;hb=d718332b42f884d9c3c2fd0cfa9b83f4973c6971;hp=1297ed9954c07cbde6114de8928bb4397076c1dc;hpb=63044b565becfd1590f500934036204960a4b8e6;p=privoxy.git diff --git a/pcre/pcre.c b/pcre/pcre.c index 1297ed99..4f8f82cd 100644 --- a/pcre/pcre.c +++ b/pcre/pcre.c @@ -730,7 +730,7 @@ if (*p == '}') max = min; else /* Do paranoid checks, then fill in the required variables, and pass back the pointer to the terminating '}'. */ -if (min > 65535 || max > 65535) +if (min < 0 || min > 65535 || max < -1 || max > 65535) *errorptr = ERR5; else { @@ -2660,8 +2660,13 @@ while ((c = *(++ptr)) != 0) } else class_charcount++; ptr++; + if (*ptr == 0) + { + *errorptr = ERR6; + goto PCRE_ERROR_RETURN; + } } - while (*ptr != 0 && *ptr != ']'); + while (*ptr != ']'); /* Repeats for negated single chars are handled by the general code */ @@ -3013,16 +3018,11 @@ while ((c = *(++ptr)) != 0) runlength++; - if (ptr > pattern + pattern_length) + if ((const char *)ptr > pattern + pattern_length) { *errorptr = "internal error"; goto PCRE_ERROR_RETURN; } - if (ptr[1] >= tables_length - ctypes_offset) - { - *errorptr = ERR6; - goto PCRE_ERROR_RETURN; - } } /* This "while" is the end of the "do" above. */