Lines 2115-2121
static void xmlGROW (xmlParserCtxtPtr ctxt) {
Link Here
|
2115 |
ctxt->input->line++; ctxt->input->col = 1; \ |
2115 |
ctxt->input->line++; ctxt->input->col = 1; \ |
2116 |
} else ctxt->input->col++; \ |
2116 |
} else ctxt->input->col++; \ |
2117 |
ctxt->input->cur += l; \ |
2117 |
ctxt->input->cur += l; \ |
2118 |
if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \ |
|
|
2119 |
} while (0) |
2118 |
} while (0) |
2120 |
|
2119 |
|
2121 |
#define CUR_CHAR(l) xmlCurrentChar(ctxt, &l) |
2120 |
#define CUR_CHAR(l) xmlCurrentChar(ctxt, &l) |
Lines 3406-3418
xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
Link Here
|
3406 |
len += l; |
3405 |
len += l; |
3407 |
NEXTL(l); |
3406 |
NEXTL(l); |
3408 |
c = CUR_CHAR(l); |
3407 |
c = CUR_CHAR(l); |
3409 |
if (c == 0) { |
|
|
3410 |
count = 0; |
3411 |
GROW; |
3412 |
if (ctxt->instate == XML_PARSER_EOF) |
3413 |
return(NULL); |
3414 |
c = CUR_CHAR(l); |
3415 |
} |
3416 |
} |
3408 |
} |
3417 |
} |
3409 |
} |
3418 |
if ((len > XML_MAX_NAME_LENGTH) && |
3410 |
if ((len > XML_MAX_NAME_LENGTH) && |
Lines 3420-3425
xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
Link Here
|
3420 |
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name"); |
3412 |
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name"); |
3421 |
return(NULL); |
3413 |
return(NULL); |
3422 |
} |
3414 |
} |
|
|
3415 |
if (ctxt->input->cur - ctxt->input->base < len) { |
3416 |
/* |
3417 |
* There were a couple of bugs where PERefs lead to to a change |
3418 |
* of the buffer. Check the buffer size to avoid passing an invalid |
3419 |
* pointer to xmlDictLookup. |
3420 |
*/ |
3421 |
xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, |
3422 |
"unexpected change of input buffer"); |
3423 |
return (NULL); |
3424 |
} |
3423 |
if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r')) |
3425 |
if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r')) |
3424 |
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len)); |
3426 |
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len)); |
3425 |
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); |
3427 |
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); |