Skip to content

Fix truncation / buffer sizes - #1034

Merged
vanosg merged 2 commits into
eggheads:developfrom
michaelortmann:fixbuffersizes
Dec 19, 2020
Merged

vanosg merged 2 commits into
eggheads:developfrom
michaelortmann:fixbuffersizes

Conversation

@michaelortmann

@michaelortmann michaelortmann commented Oct 5, 2020 •

Copy link
Copy Markdown
Member

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Fix truncation / buffer sizes

Additional description (if needed):
Found with #1028, but can/should be merged independently before #1028.

Test cases demonstrating functionality (if applicable):
it should be possible to demonstrate a truncated notice in

egg_snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s: %s.", nick, u2->handle,
and to demonstrate that this PR will fix this. But it should be enough to know, that this PR will fix compiler warnings that would occur after #1028.

@vanosg vanosg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catches! can you double-check these values and adjust if necessary?

Comment thread src/mod/irc.mod/msgcmds.c
Comment thread src/mod/irc.mod/msgcmds.c
@michaelortmann

michaelortmann commented Nov 3, 2020 •

Copy link
Copy Markdown
Member Author

Geo: For the uhostlen mess see also #650. Many compiler warnings are currently shaddowed by using egg_snprintf() instead snprintf(). For that see also #1028. There is more to come, but i want to see this PR merged rather soon instead of making one big PR, because not all compiler warnings about buffer sizes / truncation are equal. This here is one of the more serious ones and not only cosmetic.

@vanosg
vanosg merged commit 9784ccb into eggheads:develop Dec 19, 2020
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.

2 participants