mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
fixed xmlFAParseCharRange for Unicode ranges with patch from Charles
* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges with patch from Charles Bozeman.
This commit is contained in:
parent
9887395b55
commit
dc99df936c
@ -1,3 +1,8 @@
|
||||
Sat Dec 27 09:53:06 HKT 2003 William Brack <wbrack@mmm.com.hk>
|
||||
|
||||
* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges
|
||||
with patch from Charles Bozeman.
|
||||
|
||||
Fri Dec 26 14:03:41 HKT 2003 William Brack <wbrack@mmm.com.hk>
|
||||
|
||||
* xmlregexp.c: fixed problem causing segfault on validation error
|
||||
|
12
xmlregexp.c
12
xmlregexp.c
@ -3533,7 +3533,7 @@ xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) {
|
||||
*/
|
||||
static void
|
||||
xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
|
||||
int cur;
|
||||
int cur, len;
|
||||
int start = -1;
|
||||
int end = -1;
|
||||
|
||||
@ -3560,13 +3560,14 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
|
||||
return;
|
||||
}
|
||||
end = start;
|
||||
len = 1;
|
||||
} else if ((cur != 0x5B) && (cur != 0x5D)) {
|
||||
end = start = cur;
|
||||
end = start = CUR_SCHAR(ctxt->cur, len);
|
||||
} else {
|
||||
ERROR("Expecting a char range");
|
||||
return;
|
||||
}
|
||||
NEXT;
|
||||
NEXTL(len);
|
||||
if (start == '-') {
|
||||
return;
|
||||
}
|
||||
@ -3593,13 +3594,14 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
|
||||
ERROR("Invalid escape value");
|
||||
return;
|
||||
}
|
||||
len = 1;
|
||||
} else if ((cur != 0x5B) && (cur != 0x5D)) {
|
||||
end = cur;
|
||||
end = CUR_SCHAR(ctxt->cur, len);
|
||||
} else {
|
||||
ERROR("Expecting the end of a char range");
|
||||
return;
|
||||
}
|
||||
NEXT;
|
||||
NEXTL(len);
|
||||
/* TODO check that the values are acceptable character ranges for XML */
|
||||
if (end < start) {
|
||||
ERROR("End of range is before start of range");
|
||||
|
Loading…
x
Reference in New Issue
Block a user