Comment 8 for bug 321246

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Right, I agree that nicks and filenames should be treated as binary except for display (bug #351208), but my point was that we should validate any nmdc text we convert to utf-8 is actually non-empty and utf-8 before using it. My proposed solution was perhaps not the greatest, but that's of course changeable. Note that I was not proposing that we should send utf-8 to other nmdc clients, only that we should convert and validate received nmdc commands to utf-8 before handling them (right now we only convert).

My other point was that right now the conversion of nmdc params to utf-8 is spread around in other classes. I think it would be better to encapsulate this conversion inside NmdcHub so that data can be converted and validated as soon as it comes down the tubes and so that other classes can focus on their designated role instead of worrying about text conversion/validation.

I should also note that the peer can send a space or empty string for nick in $SR and still crash debug builds, so the fix I committed would still be needed regardless of encoding issues. Perhaps we should just remove the dcassert?