From 07b7200775ea3a6ac6bf676f57b470ef7cf0e0b3 Mon Sep 17 00:00:00 2001 From: Rob Richards Date: Sat, 3 Sep 2005 14:56:36 +0000 Subject: [PATCH] check for NULL to prevent crash with meta elements * xmlsave.c: check for NULL to prevent crash with meta elements --- ChangeLog | 4 ++++ xmlsave.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40110879..c8204cdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Sep 3 16:51:55 CEST 2005 Rob Richards + + * xmlsave.c: check for NULL to prevent crash with meta elements + Sat Sep 3 16:26:55 CEST 2005 Daniel Veillard * relaxng.c: structured error reporting problem with Relax-NG diff --git a/xmlsave.c b/xmlsave.c index 943a84b6..571427dc 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -1216,11 +1216,13 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { xmlChar *httpequiv; httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); - if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + if (httpequiv != NULL) { + if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + xmlFree(httpequiv); + break; + } xmlFree(httpequiv); - break; } - xmlFree(httpequiv); } tmp = tmp->next; }