[libxml2] Fix a bug in the nsclean option of the parser



commit 711b15d545713b3a34a51ce8163d1162533647c9
Author: Daniel Veillard <veillard redhat com>
Date:   Thu Oct 25 19:23:26 2012 +0800

    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 files changed, 1 insertions(+), 1 deletions(-)
---
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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]