enbility / eebus-go

EEBUS protocol implementation in go
https://enbility.net
MIT License
52 stars 14 forks source link

Fix potential race condition leading to nil dereference #105

Closed sthelen-enqs closed 2 weeks ago

sthelen-enqs commented 1 month ago

Split ApproveOrDenyLimit public functions into a public part which takes a msgCounter and resolves it to a Message using the pendingLimits as before and a private part which takes a Message and can be called directly from the internal WriteApprovalCallbacks. This removes the need to call FeatureLocalInterface.ApproveOrDenyWrite with an "empty" message when a message is not found in the pendingLimits for ApprovalRequests that don't match the current use case.

Fixes #104

DerAndereAndi commented 2 weeks ago

Thanks a lot for the great bug report and PR!