summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 363c182)
raw | patch | inline | side by side (parent: 363c182)
author | Dan Fandrich <dan@coneharvesters.com> | |
Mon, 4 Feb 2013 23:02:17 +0000 (00:02 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 5 Feb 2013 06:51:08 +0000 (07:51 +0100) |
I managed to get collectd to segfault in a couple of places while
playing with it a bit. The first is in the curl_xml module when the
XPATH expression doesn't quite match the input. The crash occurs on line
407 when instance_node->nodeTab[0] is dereferenced. At this point, all
members of instance_node are 0, so dereferencing the array isn't a good
idea. This patch fixes the problem, although I'm not sure if this
particular case actually deserves its own error message.
Signed-off-by: Florian Forster <octo@collectd.org>
playing with it a bit. The first is in the curl_xml module when the
XPATH expression doesn't quite match the input. The crash occurs on line
407 when instance_node->nodeTab[0] is dereferenced. At this point, all
members of instance_node are 0, so dereferencing the array isn't a good
idea. This patch fixes the problem, although I'm not sure if this
particular case actually deserves its own error message.
Signed-off-by: Florian Forster <octo@collectd.org>
src/curl_xml.c | patch | blob | history |
diff --git a/src/curl_xml.c b/src/curl_xml.c
index da90d7c8773256a2f1ae9dc1728de93343b8b3ff..c22172a769904f34768ef64b32971fc2453ec01b 100644 (file)
--- a/src/curl_xml.c
+++ b/src/curl_xml.c
instance_node = instance_node_obj->nodesetval;
tmp_size = (instance_node) ? instance_node->nodeNr : 0;
- if ( (tmp_size == 0) && (is_table) )
+ if (tmp_size <= 0)
{
WARNING ("curl_xml plugin: "
"relative xpath expression for 'InstanceFrom' \"%s\" doesn't match "