Thank you for taking a close look at the source code and highlighting this issue.
> You need to split on (or sanitize) null bytes
Do you mean splitting on (or sanitising of) carriage returns (CR or 0xD) and newlines (LF or 0xA)? I read your security advisory and as far as I understand, the issue occurs due to improper handling of CR and LF characters. I don't see anything about null bytes there.
Your security advisory has been quite helpful and I could reproduce the issue involving CR. It is particularly enlightening to know that the null byte could also cause the same issue because some IRC servers may interpret the null byte too as a line ending.
It is late here but I have pushed a quick fix to plug this loophole: <https://github.com/susam/nimb/commit/1c02137>. Review comments, feedback, pull requests, patches, etc. are very welcome! Thank you for this comment thread which has been constructive as well as productive.