diff options
author | David Sommerseth <davids@redhat.com> | 2009-04-28 11:07:51 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-04-29 11:22:12 +0200 |
commit | 70e35765fbb9be6ddd6aab6555916777a593e0aa (patch) | |
tree | cca903d17bf03c99be140c788d70bedcc4ab8c7f | |
parent | 75aaf67d43cf4a28fe8d3e07111dab75a0c4396d (diff) | |
download | python-dmidecode-70e35765fbb9be6ddd6aab6555916777a593e0aa.tar.gz python-dmidecode-70e35765fbb9be6ddd6aab6555916777a593e0aa.tar.xz python-dmidecode-70e35765fbb9be6ddd6aab6555916777a593e0aa.zip |
Only consider XML nodes which is of XML_ELEMENT_NODE when finding a specific node
-rw-r--r-- | src/dmixml.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dmixml.c b/src/dmixml.c index 6fcf24f..a9ecd67 100644 --- a/src/dmixml.c +++ b/src/dmixml.c @@ -190,7 +190,8 @@ xmlNode *dmixml_FindNode(xmlNode *node, const char *key) { assert( key_s != NULL ); for( ptr_n = node->children; ptr_n != NULL; ptr_n = ptr_n->next ) { - if( xmlStrcmp(ptr_n->name, key_s) == 0 ) { + if( (ptr_n->type == XML_ELEMENT_NODE) + && (xmlStrcmp(ptr_n->name, key_s) == 0) ) { free(key_s); key_s = NULL; return ptr_n; } |