Prevent null dereference

In each case there are scenarios where we would have dereferenced NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-06-21 21:43:38 -07:00
parent 18d52ec86e
commit 66375689b8
2 changed files with 7 additions and 8 deletions

View file

@ -1762,7 +1762,7 @@ static const char *nodename(xmlNode *node, char *buf, int len)
int levels = 2;
char *p = buf;
if (node->type != XML_CDATA_SECTION_NODE && (!node || !node->name)) {
if (!node || (node->type != XML_CDATA_SECTION_NODE && !node->name)) {
return "root";
}