Permalink
Browse files

Avoid dereference of null pointer in ixmlNode_setNodeProperties.

The problem can occur if one of the arguments is NULL.
Test argument and fix assertion.
  • Loading branch information...
1 parent e52e7e0 commit 3d7c1dbd5901300d0ad7db6653e8008aa54ab89c @yoichi yoichi committed Apr 19, 2012
Showing with 11 additions and 1 deletion.
  1. +7 −0 ChangeLog
  2. +4 −1 ixml/src/node.c
View
@@ -2,6 +2,13 @@
Version 1.6.18
*******************************************************************************
+2012-04-20 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
+
+ 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 <yoichi.nakayama(at)gmail.com>
Create intermediate directory per project on vc9.
View
@@ -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) {

0 comments on commit 3d7c1db

Please sign in to comment.