Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unprotected crash/panic when REST endpoint responds with 401 #175

Closed
heythisisnate opened this issue Nov 28, 2022 · 0 comments · Fixed by #176
Closed

Unprotected crash/panic when REST endpoint responds with 401 #175

heythisisnate opened this issue Nov 28, 2022 · 0 comments · Fixed by #176

Comments

@heythisisnate
Copy link
Contributor

Crashes on this line when the HTTP call on the lines above result in a 401 Unauthorized response:

gpio.mode(pin, gpio.OUTPUT)

bad argument #1 to 'mode' (number expected, got nil)
stack traceback:
	[C]: in function 'mode'
	...ecurity/konnected-security/src/lfs/rest_endpoint.lua: in function <...ecurity/konnected-security/src/lfs/rest_endpoint.lua:38>

Local variable pin should be initialized by actuator.pin in the case when the initial HTTP GET for status fails. Manifested by this HomeBridge issue: konnected-io/homebridge-konnected#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant