diff --git a/ChangeLog b/ChangeLog index 4607de17..0b4c5872 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 3 13:10:08 CET 2003 Daniel Veillard + + * config.h.in configure.in xmlregexp.c: fix bug #128401 affecting + regexp quantifiers + Tue Dec 2 23:29:56 CET 2003 Daniel Veillard * pattern.c include/libxml/pattern.h: adding the pattern node diff --git a/config.h.in b/config.h.in index 6ce26072..915ef0c8 100644 --- a/config.h.in +++ b/config.h.in @@ -107,6 +107,9 @@ /* Have compression library */ #undef HAVE_LIBZ +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if you have the `localtime' function. */ #undef HAVE_LOCALTIME diff --git a/configure.in b/configure.in index edfd4189..fd6ac344 100644 --- a/configure.in +++ b/configure.in @@ -111,6 +111,7 @@ AC_CHECK_HEADERS([ansidecl.h]) AC_CHECK_HEADERS([ieeefp.h]) AC_CHECK_HEADERS([nan.h]) AC_CHECK_HEADERS([math.h]) +AC_CHECK_HEADERS([limits.h]) AC_CHECK_HEADERS([fp_class.h]) AC_CHECK_HEADERS([float.h]) AC_CHECK_HEADERS([stdlib.h]) diff --git a/xmlregexp.c b/xmlregexp.c index a26b8bb1..f42b38c6 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -21,12 +21,20 @@ #include #include +#ifdef HAVE_LIMITS_H +#include +#endif + #include #include #include #include #include +#ifndef INT_MAX +#define INT_MAX 123456789 /* easy to flag and big enough for our needs */ +#endif + /* #define DEBUG_REGEXP_GRAPH */ /* #define DEBUG_REGEXP_EXEC */ /* #define DEBUG_PUSH */ @@ -3749,9 +3757,16 @@ xmlFAParseQuantifier(xmlRegParserCtxtPtr ctxt) { min = cur; if (CUR == ',') { NEXT; - cur = xmlFAParseQuantExact(ctxt); - if (cur >= 0) - max = cur; + if (CUR == '}') + max = INT_MAX; + else { + cur = xmlFAParseQuantExact(ctxt); + if (cur >= 0) + max = cur; + else { + ERROR("Improper quantifier"); + } + } } if (CUR == '}') { NEXT;