Fix writing to tls socket #1849
Open
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.
Found by: https://github.com/michaelortmann/
Patch by: https://github.com/michaelortmann/
Fixes:
One-line summary:
Fix writing to tls socket
Additional description (if needed):
SSL_write()intputs()eggdrop/src/net.c
Line 1346 in 890e7e4
ssl_info()which can call
debug1():eggdrop/src/tls.c
Lines 900 to 902 in 890e7e4
which can destroy memory by a chain of events like
dprintf()->dprint()->out_dcc_general()->escape_telnet()with the following static buffer:eggdrop/src/dcc.c
Line 95 in 890e7e4
In this case, during
SSL_write(), garbage (len bytes of the debug message) will be written to the tls socket.This PR changes the
escape_telnet()function, so it doesnt use a static buffer anymore. Only pros, no cons.This bug is since at least eggdrop 1.8.3rc1, #497
Test cases demonstrating functionality (if applicable):
> openssl s_client -connect 127.0.0.1:3343Before:
After: