Open dgw opened 7 months ago
irc.utils.safe() strips CR and LF from its input, but not NUL (\x00) even though all three octets are disallowed in IRC lines.
irc.utils.safe()
\x00
https://github.com/sopel-irc/sopel/blob/3ff58c160ecc7a9d51f1e06426d456c7db4d985a/sopel/irc/utils.py#L20-L48
Plugins accidentally sending NUL will most likely cause the server to disconnect the bot with an error ("malformed data" or similar).
Plugin authors must manually ensure that anything their code sends to IRC does not contain the NUL byte.
No response
Requested Feature
irc.utils.safe()
strips CR and LF from its input, but not NUL (\x00
) even though all three octets are disallowed in IRC lines.https://github.com/sopel-irc/sopel/blob/3ff58c160ecc7a9d51f1e06426d456c7db4d985a/sopel/irc/utils.py#L20-L48
Problems Solved
Plugins accidentally sending NUL will most likely cause the server to disconnect the bot with an error ("malformed data" or similar).
Alternatives
Plugin authors must manually ensure that anything their code sends to IRC does not contain the NUL byte.
Notes
No response