Wardje/ircbot — Issue #1: Huge block of text input causes wrong input parsing
Author: Wardje
Created: 2011-12-09 16:50:55+00:00
State: open

When a huge wall of text comes in, the handling of input is too naive. More precisely, we read in any chunk of 4096 bytes, then split that up according to "\r\n". However, suppose buffer already is at 4050 and another line comes in, then on the next read we will only read in *part* of that last line. This gives potential rise to abuse if that last line is content that could be interpreted as valid IRC talk.

Someone would have to go through quite some effort, I believe, to actually time the abusive command that way, but it should still be fixed.

Potential fixes:

* Increase the amount of bytes read in on every turn. This doesn't sound like a permanent solution as the actual problem could still surface, albeit slightly harder to obtain.
* Don't clear entire buffer like that, but instead clear till end of lines. This seems like the only permanent solution to the problem.