From dbcbbd2657d31366ae282bcd488b55c1318b0179 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 18 Jun 2006 19:55:20 +0000 Subject: [PATCH] try to fix the crash raised by the parser in recover mode as pointed by * parser.c: try to fix the crash raised by the parser in recover mode as pointed by Ryan Phillips Daniel --- ChangeLog | 5 +++++ parser.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0098c57..092636b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 18 20:59:02 EDT 2006 Daniel Veillard + + * parser.c: try to fix the crash raised by the parser in + recover mode as pointed by Ryan Phillips + Sun Jun 18 18:44:56 EDT 2006 Daniel Veillard * python/types.c: patch from Nic Ferrier to provide a better type diff --git a/parser.c b/parser.c index 12b2d7f8..a426b797 100644 --- a/parser.c +++ b/parser.c @@ -1442,7 +1442,7 @@ static int spacePop(xmlParserCtxtPtr ctxt) { if (ctxt->spaceNr > 0) ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1]; else - ctxt->space = NULL; + ctxt->space = &ctxt->spaceTab[0]; ret = ctxt->spaceTab[ctxt->spaceNr]; ctxt->spaceTab[ctxt->spaceNr] = -1; return(ret); @@ -2356,7 +2356,7 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, /* * Check for xml:space value. */ - if (*(ctxt->space) == 1) + if ((ctxt->space == NULL) || (*(ctxt->space) == 1)) return(0); /*