From 711b15d545713b3a34a51ce8163d1162533647c9 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 25 Oct 2012 19:23:26 +0800 Subject: [PATCH] Fix a bug in the nsclean option of the parser Raised as a side effect of: https://bugzilla.gnome.org/show_bug.cgi?id=663844 --- parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 19f1217..43f53d9 100644 --- a/parser.c +++ b/parser.c @@ -1540,7 +1540,7 @@ nsPush(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URL) { if (ctxt->options & XML_PARSE_NSCLEAN) { int i; - for (i = 0;i < ctxt->nsNr;i += 2) { + for (i = ctxt->nsNr - 2;i >= 0;i -= 2) { if (ctxt->nsTab[i] == prefix) { /* in scope */ if (ctxt->nsTab[i + 1] == URL) -- 1.8.0