fix bug #128401 affecting regexp quantifiers Daniel
* config.h.in configure.in xmlregexp.c: fix bug #128401 affecting
regexp quantifiers
Daniel
diff --git a/xmlregexp.c b/xmlregexp.c
index a26b8bb..f42b38c 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -21,12 +21,20 @@
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include <libxml/tree.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlregexp.h>
#include <libxml/xmlautomata.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_EXEC */
/* #define DEBUG_PUSH */
@@ -3749,9 +3757,16 @@
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;