1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-17 18:21:05 +03:00

fix bug #128401 affecting regexp quantifiers Daniel

* config.h.in configure.in xmlregexp.c: fix bug #128401 affecting
  regexp quantifiers
Daniel
This commit is contained in:
Daniel Veillard
2003-12-03 12:12:27 +00:00
parent b3de70c282
commit ebe48c60cc
4 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Wed Dec 3 13:10:08 CET 2003 Daniel Veillard <daniel@veillard.com>
* config.h.in configure.in xmlregexp.c: fix bug #128401 affecting
regexp quantifiers
Tue Dec 2 23:29:56 CET 2003 Daniel Veillard <daniel@veillard.com> Tue Dec 2 23:29:56 CET 2003 Daniel Veillard <daniel@veillard.com>
* pattern.c include/libxml/pattern.h: adding the pattern node * pattern.c include/libxml/pattern.h: adding the pattern node

View File

@ -107,6 +107,9 @@
/* Have compression library */ /* Have compression library */
#undef HAVE_LIBZ #undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `localtime' function. */ /* Define to 1 if you have the `localtime' function. */
#undef HAVE_LOCALTIME #undef HAVE_LOCALTIME

View File

@ -111,6 +111,7 @@ AC_CHECK_HEADERS([ansidecl.h])
AC_CHECK_HEADERS([ieeefp.h]) AC_CHECK_HEADERS([ieeefp.h])
AC_CHECK_HEADERS([nan.h]) AC_CHECK_HEADERS([nan.h])
AC_CHECK_HEADERS([math.h]) AC_CHECK_HEADERS([math.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([fp_class.h]) AC_CHECK_HEADERS([fp_class.h])
AC_CHECK_HEADERS([float.h]) AC_CHECK_HEADERS([float.h])
AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([stdlib.h])

View File

@ -21,12 +21,20 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#include <libxml/tree.h> #include <libxml/tree.h>
#include <libxml/parserInternals.h> #include <libxml/parserInternals.h>
#include <libxml/xmlregexp.h> #include <libxml/xmlregexp.h>
#include <libxml/xmlautomata.h> #include <libxml/xmlautomata.h>
#include <libxml/xmlunicode.h> #include <libxml/xmlunicode.h>
#ifndef INT_MAX
#define INT_MAX 123456789 /* easy to flag and big enough for our needs */
#endif
/* #define DEBUG_REGEXP_GRAPH */ /* #define DEBUG_REGEXP_GRAPH */
/* #define DEBUG_REGEXP_EXEC */ /* #define DEBUG_REGEXP_EXEC */
/* #define DEBUG_PUSH */ /* #define DEBUG_PUSH */
@ -3749,9 +3757,16 @@ xmlFAParseQuantifier(xmlRegParserCtxtPtr ctxt) {
min = cur; min = cur;
if (CUR == ',') { if (CUR == ',') {
NEXT; NEXT;
if (CUR == '}')
max = INT_MAX;
else {
cur = xmlFAParseQuantExact(ctxt); cur = xmlFAParseQuantExact(ctxt);
if (cur >= 0) if (cur >= 0)
max = cur; max = cur;
else {
ERROR("Improper quantifier");
}
}
} }
if (CUR == '}') { if (CUR == '}') {
NEXT; NEXT;