[collectd] A couple of collectd crashes

Dan Fandrich dan at coneharvesters.com
Tue Feb 5 00:33:33 CET 2013

On Tue, Feb 05, 2013 at 12:02:17AM +0100, Dan Fandrich wrote:
> 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. 

I've spotted some other questionable code around there.
cx_handle_instance_xpath() line 362 unconditionally clears the block starting
at vl->type_instance, but only at line 368 does it check if that's a NULL
pointer. Also, line 387 sets tmp_size to 0 if instance_node is NULL, then
exits the function on line 395. Then, way down at line 420, it checks
if instance_node is NULL and treats it differently, but it cannot be NULL
at that point. Clearly, the logic in this module needs some love. I don't
quite feel so bad now in failing to get my XPATH configuration right on the
first try!

>>> Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 308 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130205/6bdb2af4/attachment.pgp>

More information about the collectd mailing list