Commit 9fe88b4
common/wireaddr: Fix an out-of-bounds bug in the address parser
Changelog-Fixed: In `struct wireaddr`, the `addr` buffer is defined
with a length of DNS_ADDRLEN (255). When parsing a valid DNS name
that is exactly 255 bytes long, the subsequent attempt to append a
`NULL` terminator overruns the buffer and triggers an out-of-bounds
error under UBSan.
Fix this by removing the line that appends `NULL`. This change is
safe because the preceding call to:
`memset(&addr->addr, 0, sizeof(addr->addr))`
already zeroes the entire buffer.1 parent 5cc8d0a commit 9fe88b4
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
0 commit comments