From 3d7c1dbd5901300d0ad7db6653e8008aa54ab89c Mon Sep 17 00:00:00 2001 From: Yoichi NAKAYAMA Date: Fri, 20 Apr 2012 03:42:02 +0900 Subject: [PATCH] Avoid dereference of null pointer in ixmlNode_setNodeProperties. The problem can occur if one of the arguments is NULL. Test argument and fix assertion. --- ChangeLog | 7 +++++++ ixml/src/node.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c7d3d3..afd5c9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ Version 1.6.18 ******************************************************************************* +2012-04-20 Yoichi NAKAYAMA + + Avoid dereference of null pointer in ixmlNode_setNodeProperties. + + The problem can occur if one of the arguments is NULL. + Test argument and fix assertion. + 2012-04-17 Yoichi NAKAYAMA Create intermediate directory per project on vc9. diff --git a/ixml/src/node.c b/ixml/src/node.c index c20b841..1d1ec16 100644 --- a/ixml/src/node.c +++ b/ixml/src/node.c @@ -1339,7 +1339,10 @@ int ixmlNode_setNodeProperties( { int rc; - assert(destNode != NULL || src != NULL); + assert(destNode != NULL && src != NULL); + if(destNode == NULL || src == NULL) { + return IXML_INVALID_PARAMETER; + } rc = ixmlNode_setNodeValue(destNode, src->nodeValue); if(rc != IXML_SUCCESS) {