mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
fix bug #414846 where invalid characters in attributes would sometimes not
* parser.c: fix bug #414846 where invalid characters in attributes would sometimes not be detected. * test/errors/attr4.xml result/errors/attr4.xml*: added a specific test case to the regression tests Daniel svn path=/trunk/; revision=3634
This commit is contained in:
parent
3130fe95db
commit
b9e5acc490
@ -1,3 +1,10 @@
|
||||
Tue Jun 12 15:41:09 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c: fix bug #414846 where invalid characters in attributes
|
||||
would sometimes not be detected.
|
||||
* test/errors/attr4.xml result/errors/attr4.xml*: added a specific
|
||||
test case to the regression tests
|
||||
|
||||
Tue Jun 12 14:23:24 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xstc/Makefile.am: apply patch from Ryan Hill to cope with changes
|
||||
|
7
parser.c
7
parser.c
@ -3074,7 +3074,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
|
||||
*/
|
||||
c = CUR_CHAR(l);
|
||||
while ((NXT(0) != limit) && /* checked */
|
||||
(c != '<')) {
|
||||
(IS_CHAR(c)) && (c != '<')) {
|
||||
if (c == 0) break;
|
||||
if (c == '&') {
|
||||
in_space = 0;
|
||||
@ -3208,8 +3208,13 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
|
||||
if (RAW == '<') {
|
||||
xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
|
||||
} else if (RAW != limit) {
|
||||
if ((c != 0) && (!IS_CHAR(c))) {
|
||||
xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
|
||||
"invalid character in attribute value\n");
|
||||
} else {
|
||||
xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
|
||||
"AttValue: ' expected\n");
|
||||
}
|
||||
} else
|
||||
NEXT;
|
||||
if (attlen != NULL) *attlen = len;
|
||||
|
0
result/errors/attr4.xml
Normal file
0
result/errors/attr4.xml
Normal file
12
result/errors/attr4.xml.err
Normal file
12
result/errors/attr4.xml.err
Normal file
@ -0,0 +1,12 @@
|
||||
./test/errors/attr4.xml:1: parser error : invalid character in attribute value
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml:1: parser error : attributes construct error
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml:1: parser error : Couldn't find end of Start Tag ROOT line 1
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml:1: parser error : Extra content at the end of the document
|
||||
<ROOT attr="XY"/>
|
||||
^
|
10
result/errors/attr4.xml.str
Normal file
10
result/errors/attr4.xml.str
Normal file
@ -0,0 +1,10 @@
|
||||
./test/errors/attr4.xml:1: parser error : invalid character in attribute value
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml:1: parser error : attributes construct error
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml:1: parser error : Couldn't find end of Start Tag ROOT
|
||||
<ROOT attr="XY"/>
|
||||
^
|
||||
./test/errors/attr4.xml : failed to parse
|
1
test/errors/attr4.xml
Normal file
1
test/errors/attr4.xml
Normal file
@ -0,0 +1 @@
|
||||
<ROOT attr="XY"/>
|
Loading…
x
Reference in New Issue
Block a user