From b65e12e3c5bdb7742e8594c296a47ab514343b59 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 8 Oct 2003 21:33:28 +0000 Subject: [PATCH] bug in compression saving was crashing galeon, reported by teuf Daniel * parser.c: bug in compression saving was crashing galeon, reported by teuf Daniel --- ChangeLog | 5 +++++ parser.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 809e0a24..671670ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 8 23:31:23 CEST 2003 Daniel Veillard + + * parser.c: bug in compression saving was crashing galeon + reported by teuf + Wed Oct 8 21:18:12 CEST 2003 Daniel Veillard * error.c tree.c xmlIO.c xmllint.c: more cleanup through the diff --git a/parser.c b/parser.c index 33fe5ee8..656e4bd2 100644 --- a/parser.c +++ b/parser.c @@ -11392,10 +11392,12 @@ xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename, if ((ctxt->wellFormed) || recovery) { ret = ctxt->myDoc; - if (ctxt->input->buf->compressed > 0) - ret->compression = 9; - else - ret->compression = ctxt->input->buf->compressed; + if (ret != NULL) { + if (ctxt->input->buf->compressed > 0) + ret->compression = 9; + else + ret->compression = ctxt->input->buf->compressed; + } } else { ret = NULL;