summaryrefslogtreecommitdiff
path: root/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch')
-rw-r--r--debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch b/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch
new file mode 100644
index 0000000..442fd11
--- /dev/null
+++ b/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch
@@ -0,0 +1,57 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Wed, 22 May 2013 20:56:45 +0000
+Subject: Fix a parsing bug on non-ascii element and CR/LF usage
+
+https://bugzilla.gnome.org/show_bug.cgi?id=698550
+
+Somehow the behaviour of the internal parser routine changed
+slightly when encountering CR/LF, which led to a bug when
+parsing document with non-ascii Names
+---
+ parser.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/parser.c b/parser.c
+index b9df6d8..dd00399 100644
+--- a/parser.c
++++ b/parser.c
+@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ int len = 0, l;
+ int c;
+ int count = 0;
++ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */
+
+ #ifdef DEBUG
+ nbParseNCNameComplex++;
+@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ * Handler for more complex cases
+ */
+ GROW;
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
+ (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) {
+@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ }
+ len += l;
+ NEXTL(l);
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ if (c == 0) {
+ count = 0;
+ GROW;
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ }
+ }
+@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
+ return(NULL);
+ }
+- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
++ return(xmlDictLookup(ctxt->dict, end - len, len));
+ }
+
+ /**