fix: Off-by-one buffer errors in ircd_snprintf and ircd_strncpy calls #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
[SIZE+1]were passed toircd_snprintforircd_strncpywithSIZEinstead ofSIZE+1ircd_snprintf(0, buf, n, ...)writes at mostn-1characters plus null terminatorircd_strncpy(dest, src, n)copiesn-1characters plus null terminatorSIZEinstead ofSIZE+1truncates the last valid characterFiles Changed
tmphost[HOSTLEN+1]buffer inadd_banid()- fix snprintf sizeiphost[HOSTLEN+1]buffer - fix 5 snprintf callsnewhost[HOSTLEN+1]buffer inhide_hostmask()- fix 2 snprintf callsuser:1234567890) - fixircd_strncpylength calculationTest plan
🤖 Generated with Claude Code