Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/libxml/src/parser.c

Issue 1873693002: Do not advance beyond the closing tag length in xmlParseEndTag2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr595262
Patch Set: Use patch from upstream bug. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * parser.c : an XML 1.0 parser, namespaces and validity support are mostly 2 * parser.c : an XML 1.0 parser, namespaces and validity support are mostly
3 * implemented on top of the SAX interfaces 3 * implemented on top of the SAX interfaces
4 * 4 *
5 * References: 5 * References:
6 * The XML specification: 6 * The XML specification:
7 * http://www.w3.org/TR/REC-xml 7 * http://www.w3.org/TR/REC-xml
8 * Original 1.0 version: 8 * Original 1.0 version:
9 * http://www.w3.org/TR/1998/REC-xml-19980210 9 * http://www.w3.org/TR/1998/REC-xml-19980210
10 * XML second edition working draft 10 * XML second edition working draft
(...skipping 9807 matching lines...) Expand 10 before | Expand all | Expand 10 after
9818 const xmlChar *URI, int line, int nsNr, int tlen) { 9818 const xmlChar *URI, int line, int nsNr, int tlen) {
9819 const xmlChar *name; 9819 const xmlChar *name;
9820 9820
9821 GROW; 9821 GROW;
9822 if ((RAW != '<') || (NXT(1) != '/')) { 9822 if ((RAW != '<') || (NXT(1) != '/')) {
9823 xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL); 9823 xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
9824 return; 9824 return;
9825 } 9825 }
9826 SKIP(2); 9826 SKIP(2);
9827 9827
9828 if ((tlen > 0) && (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { 9828 size_t curLength = ctxt->input->end - ctxt->input->cur;
9829 if (ctxt->input->cur[tlen] == '>') { 9829 if ((tlen > 0) && (curLength >= (size_t)tlen) && (xmlStrncmp(ctxt->input->cu r, ctxt->name, tlen) == 0)) {
9830 if ((curLength >= (size_t)(tlen + 1)) && (ctxt->input->cur[tlen] == '>')) {
9830 ctxt->input->cur += tlen + 1; 9831 ctxt->input->cur += tlen + 1;
9831 ctxt->input->col += tlen + 1; 9832 ctxt->input->col += tlen + 1;
9832 goto done; 9833 goto done;
9833 } 9834 }
9834 ctxt->input->cur += tlen; 9835 ctxt->input->cur += tlen;
9835 ctxt->input->col += tlen; 9836 ctxt->input->col += tlen;
9836 name = (xmlChar*)1; 9837 name = (xmlChar*)1;
9837 } else { 9838 } else {
9838 if (prefix == NULL) 9839 if (prefix == NULL)
9839 name = xmlParseNameAndCompare(ctxt, ctxt->name); 9840 name = xmlParseNameAndCompare(ctxt, ctxt->name);
(...skipping 5927 matching lines...) Expand 10 before | Expand all | Expand 10 after
15767 if (stream == NULL) { 15768 if (stream == NULL) {
15768 xmlFreeParserInputBuffer(input); 15769 xmlFreeParserInputBuffer(input);
15769 return (NULL); 15770 return (NULL);
15770 } 15771 }
15771 inputPush(ctxt, stream); 15772 inputPush(ctxt, stream);
15772 return (xmlDoRead(ctxt, URL, encoding, options, 1)); 15773 return (xmlDoRead(ctxt, URL, encoding, options, 1));
15773 } 15774 }
15774 15775
15775 #define bottom_parser 15776 #define bottom_parser
15776 #include "elfgcchack.h" 15777 #include "elfgcchack.h"
OLDNEW
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698