diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 19:12:46 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 19:12:46 +0000 |
commit | 505115c27f5454df0878407c7706c7f1c3744b0d (patch) | |
tree | df43feb18444d5be3bf35ed3ee16156d49e17776 /third_party/libxml/xinclude.c | |
parent | e8c2172aa23158985682d232cf290593b8206b90 (diff) | |
download | chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.zip chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.gz chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.bz2 |
Updates libxml to 2.6.32. Updated google.patch and README.google
BUG=1300342
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libxml/xinclude.c')
-rw-r--r-- | third_party/libxml/xinclude.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/third_party/libxml/xinclude.c b/third_party/libxml/xinclude.c index 31ea026..bb41180 100644 --- a/third_party/libxml/xinclude.c +++ b/third_party/libxml/xinclude.c @@ -419,7 +419,6 @@ static xmlDocPtr xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { xmlDocPtr ret; xmlParserCtxtPtr pctxt; - char *directory = NULL; xmlParserInputPtr inputStream; xmlInitParser(); @@ -456,10 +455,8 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { inputPush(pctxt, inputStream); - if ((pctxt->directory == NULL) && (directory == NULL)) - directory = xmlParserGetDirectory(URL); - if ((pctxt->directory == NULL) && (directory != NULL)) - pctxt->directory = (char *) xmlStrdup((xmlChar *) directory); + if (pctxt->directory == NULL) + pctxt->directory = xmlParserGetDirectory(URL); pctxt->loadsubset |= XML_DETECT_IDS; @@ -516,9 +513,8 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */ if (href == NULL) return(-1); - local = 1; } - if (href[0] == '#') + if ((href[0] == '#') || (href[0] == 0)) local = 1; parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); if (parse != NULL) { @@ -617,6 +613,19 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { } /* + * If local and xml then we need a fragment + */ + if ((local == 1) && (xml == 1) && + ((fragment == NULL) || (fragment[0] == 0))) { + xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, + "detected a local recursion with no xpointer in %s\n", + URL); + if (fragment != NULL) + xmlFree(fragment); + return(-1); + } + + /* * Check the URL against the stack for recursions */ if ((!local) && (xml == 1)) { |