mcktr / check_fritz

Check plugin written in Go to monitor a Fritz!Box
GNU General Public License v2.0
32 stars 10 forks source link

Fix nil pointer dereference in smart check methods #91

Closed mcktr closed 4 years ago

mcktr commented 4 years ago

Fixes a nil pointer dereference in the smart check methods. The AIN needs to be set for the check methods.

before

$ go run cmd/check_fritz/*.go -H 192.168.178.1 -p secret -m smart_heatertemperatur
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x77aabb]

after

$ go run cmd/check_fritz/*.go -H 192.168.178.1 -p secret -m smart_heatertemperatur
UNKNOWN - a AIN needs to be set for this check method
exit status 3

fixes #88