Repository navigation
Commit 090f4b0
lightningd/peer_control: initialize error pointer in handle_peer_spoke
The local variable `error` in handle_peer_spoke() is declared as a
pointer type with no initialization. Several error paths jump to the
`send_error` label where `error` is dereferenced (passed to
tal_hex() and towire_connectd_peer_send_msg()). While sockpair()
currently sets the `error` pointer via the output parameter on
failure, the declaration should be initialized to NULL as a defensive
measure and to avoid undefined behavior if code paths change.
Fixes #8849
Changelog-Fixed: peer_control: initialize error pointer in handle_peer_spoke to NULL to prevent undefined behavior on error paths.1 parent c4fe4cb commit 090f4b0
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2017 | 2017 | | |
2018 | 2018 | | |
2019 | 2019 | | |
2020 | | - | |
| 2020 | + | |
2021 | 2021 | | |
2022 | 2022 | | |
2023 | 2023 | | |
| |||
0 commit comments