]> git.itanic.dy.fi Git - rrdd/commit
onewire_parser: Fix crash caused by off by one memory allocation
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 29 Jan 2017 15:03:00 +0000 (17:03 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 29 Jan 2017 15:03:00 +0000 (17:03 +0200)
commit5e531d1af9aa28b1d89c72b65cba034baa2a05a3
tree15dab3c8c6c549026507831d1b5769eceb0828c2
parenta12b785bb7b853742c1dc4e31afc6623e49ca1aa
onewire_parser: Fix crash caused by off by one memory allocation

The entries in sensor list always start with either server address or
mount point, which is not counted as a sensor. If we want to count the
actual number of sensors, we obviously need to add one more to the
last index number, otherwise we get one too small number for sensors
and allocate too little of memory for the parser state.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
onewire_parser.c