]> git.ipfire.org Git - people/ms/python-rrdtool.git/commit
Fix crash in lastupdate() method fix-lastupdate-crash
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 23 Nov 2015 02:15:33 +0000 (02:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 23 Nov 2015 02:15:33 +0000 (02:15 +0000)
commita45ed2ad6f92730a479522c46febb1b56b442aba
tree562c261497dd7d812a378277b568160eb85c678a
parentedc98dcd1b4694821c6cd676eb7fd7915cba7d3e
Fix crash in lastupdate() method

When a RRD database contains floating point values, the
PyRRD_Int_FromString function returns NULL, which will then be tried
to be put into a dictionary.
This operation fails as PyDict_SetItemString does not handle NULL
and the program crashes with SEGV.

This patch parses the value as a floating point number
and will add that instead. If the value could not be parsed,
None will be added instead.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
rrdtoolmodule.c