Skip to content

Commit 784d91f

Browse files
Brian C. Youngandi34
authored andcommitted
DO NOT MERGE: Apply upstream Chromium patch for encoding changes
Give up looking up interned names if the encoding changed during parsing NEXTL may process encoding changes by refilling the parser's input buffer, which makes the accumulated length 'len' inaccurate. Chromium bug: http://crbug.com/620679 Review-Url: https://codereview.chromium.org/2603933002 Cr-Commit-Position: refs/heads/master@{#442517} Bug: 36553781 Change-Id: Id3484fbee201d1e19b684b109009d6590354b1d9 (cherry picked from commit 008262d3e46b3d5aae2d2f981e26ca69c8bd2b51)
1 parent feeb1ee commit 784d91f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

parser.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3258,8 +3258,15 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
32583258
c = CUR_CHAR(l);
32593259
}
32603260
}
3261-
if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
3261+
if (ctxt->input->cur > ctxt->input->base && (*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r')) {
3262+
if (ctxt->input->base > ctxt->input->cur - (len + 1)) {
3263+
return(NULL);
3264+
}
32623265
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len));
3266+
}
3267+
if (ctxt->input->base > ctxt->input->cur - len) {
3268+
return(NULL);
3269+
}
32633270
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
32643271
}
32653272

0 commit comments

Comments
 (0)