konnected-io / konnected-security

Konnected connects wired sensors and switches to SmartThings, Home Assistant, Hubitat and OpenHAB
https://konnected.io
Apache License 2.0
418 stars 323 forks source link

Fix to handle nil payload in request data #76

Closed bazza2000 closed 5 years ago

bazza2000 commented 5 years ago

Error below occurs when a rouge request is received from an unknown origin on my network.

Heap:   28320   UPnP:   Sent SSDP NOTIFY
PANIC: unprotected error in call to Lua API (/opt/nodemcu-firmware/local/fs/httpd_req.lua:26: bad argument #2 to 'sub' (number expected, got nil))

Ran the patched code (including else statement to track occurrences) for 72 hours with no recurrence.