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) | ||
commit | b0c32ea6b670877e573913139f05d5c110e50861 | |
tree | 8210bc36143b8efaffb18c005d6deb5239a9131c | tree | snapshot |
parent | 363c182af2404710a5946ea3d9bb93f29f7927c0 | commit | diff |
curl_xml plugin: Fix potential dereference of NULL pointer.
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>
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>
src/curl_xml.c | diff | blob | history |