mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fixed bug #59981 related to handling of '&' in attributes when entities
* parser.c result/noent/wml.xml: fixed bug #59981 related to handling of '&' in attributes when entities are substitued Daniel
This commit is contained in:
60
parser.c
60
parser.c
@ -2212,36 +2212,50 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
|
||||
(c != '<')) || (ctxt->token != 0)) {
|
||||
if (c == 0) break;
|
||||
if (ctxt->token == '&') {
|
||||
/*
|
||||
* The reparsing will be done in xmlStringGetNodeList()
|
||||
* called by the attribute() function in SAX.c
|
||||
*/
|
||||
static xmlChar buffer[6] = "&";
|
||||
if (ctxt->replaceEntities) {
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
}
|
||||
buf[len++] = '&';
|
||||
} else {
|
||||
/*
|
||||
* The reparsing will be done in xmlStringGetNodeList()
|
||||
* called by the attribute() function in SAX.c
|
||||
*/
|
||||
static xmlChar buffer[6] = "&";
|
||||
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
}
|
||||
current = &buffer[0];
|
||||
while (*current != 0) { /* non input consuming */
|
||||
buf[len++] = *current++;
|
||||
}
|
||||
ctxt->token = 0;
|
||||
}
|
||||
current = &buffer[0];
|
||||
while (*current != 0) { /* non input consuming */
|
||||
buf[len++] = *current++;
|
||||
}
|
||||
ctxt->token = 0;
|
||||
} else if (c == '&') {
|
||||
if (NXT(1) == '#') {
|
||||
int val = xmlParseCharRef(ctxt);
|
||||
if (val == '&') {
|
||||
/*
|
||||
* The reparsing will be done in xmlStringGetNodeList()
|
||||
* called by the attribute() function in SAX.c
|
||||
*/
|
||||
static xmlChar buffer[6] = "&";
|
||||
if (ctxt->replaceEntities) {
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
}
|
||||
buf[len++] = '&';
|
||||
} else {
|
||||
/*
|
||||
* The reparsing will be done in xmlStringGetNodeList()
|
||||
* called by the attribute() function in SAX.c
|
||||
*/
|
||||
static xmlChar buffer[6] = "&";
|
||||
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
}
|
||||
current = &buffer[0];
|
||||
while (*current != 0) { /* non input consuming */
|
||||
buf[len++] = *current++;
|
||||
if (len > buf_size - 10) {
|
||||
growBuffer(buf);
|
||||
}
|
||||
current = &buffer[0];
|
||||
while (*current != 0) { /* non input consuming */
|
||||
buf[len++] = *current++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (len > buf_size - 10) {
|
||||
|
Reference in New Issue
Block a user