FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: off-by-two in printinaddr remaining-length accounting by jiegec · Pull Request #366 · lsof-org/lsof · GitHub

/ lsof Public

fix: off-by-two in printinaddr remaining-length accounting - #366

Merged
jiegec merged 1 commit into
masterfrom
fix-off-by-two-in-printinaddr
Jul 17, 2026
Merged

fix: off-by-two in printinaddr remaining-length accounting#366
jiegec merged 1 commit into
masterfrom
fix-off-by-two-in-printinaddr

Conversation

jiegec commented Jul 13, 2026

Copy link
Copy Markdown
Member

In printinaddr(), the remaining-length counter nl was decremented by len - 1 instead of len + 1 after writing ":" + port string (len + 1 bytes). This inflates nl by 2 after each port field, allowing the final snpf() to write 2 bytes past the end of the heap-allocated Namech buffer.

Reported-by: f9j2n6nd8k-eng
Fixes #365

In printinaddr(), the remaining-length counter nl was decremented by
len - 1 instead of len + 1 after writing ":" + port string (len + 1
bytes). This inflated nl by 2 after each port field, allowing the final
snpf() to write 2 bytes past the end of the heap-allocated Namech buffer.

Reported-by: f9j2n6nd8k-eng
Fixes #365
jiegec merged commit 0bd6985 into master Jul 17, 2026
17 checks passed
jiegec deleted the fix-off-by-two-in-printinaddr branch July 17, 2026 15:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 this pull request may close these issues.

[BUG]off-by-two in printinaddr() remaining-length accounting

1 participant


Back | FazBrowse Home | New Git URL