-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISO charset make crash with python #1711
Comments
Here a gdb of SEGMENT VIOLATION with python and simple bind |
Can repeat. scripts/1711.py:
Bot:
Sending But sending
gdb: So, in this example, the last 2 bytes eggdrop read from PRIVMSG from server are 0xc3 0xa0. eggdrop reads them in mainloop() via sockgets(). it will replace the linefeed 0xa0 with null terminator 0x00. then mainloop() calls 0xc3 is a valid char, that is not filtered out or modified by eggdrop in any way. but it is no valid utf8. 0xc3 is 0b11000011, the 2 high bits are set, so, if some code would treat it as if it were valid utf8 it would expect one or more chars to follow, but there is only 0x00 following. such unsafe code could crash. I dont think eggdrop cares about utf8 (do we parse uf8 anywhere???). that means, tcl and/or python crashes on invalid utf8 and eggdrop must make sure, it doesnt feed invalid utf8 into tcl/python functions that would stumble upon it. |
btw: gdb is utf8 aware, wil try to decode it, and in this example it will print |
in |
Hello
On eggdrop 1.10 and python 3.12.6 (running on manjaro linux 6.1)
When bind on event like pubm, part, quit with messages contains ISO char like éèçà, eggdrop crash.
Simple to reproduce :
Compile an eggdrop with default parameters.
Load python.
Add script with bind like
bind("pubm", "*", "*", onMessage))
and proc likedef onMessage(nick, mask, handle, channel, msg=''): pass
Go to channel with bot and send message with charset like iso-8859-15 and special char.
Crash.
Cant produce gdb for now, i add one to night
The text was updated successfully, but these errors were encountered: