eggdrop icon indicating copy to clipboard operation
eggdrop copied to clipboard

snprintf with overlapping source and dest strings

Open michaelortmann opened this issue 5 years ago • 0 comments

https://github.com/eggheads/eggdrop/blob/6e9aeacf78fe2b869d73e2c07819619415c1cb25/src/mod/server.mod/server.c#L586

snprintf with overlapping source and dest strings is undefined behaviour, dst is char * restrict.

After inserting debug code i was able to see a real bug here.

I found this with #1028, but Will Buckner also found this before me in 2005:

http://lists.eggheads.org/pipermail/eggdev/2005-April/015490.html

He mentioned a patch, but i checked eggdrops commit history and this patch never made it into eggdrop.

My attempt to contact Mr. Buckner failed due to his old email address being not valid anymore.

michaelortmann avatar Nov 04 '20 21:11 michaelortmann