News for hackers. Stuff that matters.
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by jeffbee on Tuesday March 26, 2024 @10:40AM (#39828511)
There are various contexts where the inputs are defined to be UTF-8 and nonconforming inputs are rejected. For example, a `string` field in a protocol buffer.
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by geraldcombs on Tuesday March 26, 2024 @12:24PM (#39829673)
This could be generalized to any `string` field in any network packet.
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by jeffbee on Tuesday March 26, 2024 @12:40PM (#39829893)
I don't see how. A user of a conforming protobuf library can assume, after a successful decode, that a string field contains valid UTF-8. That doesn't generalize to everything called "string".
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by geraldcombs on Tuesday March 26, 2024 @01:18PM (#39830384)
I was trying to make the point that string validation isn't limited to protobuf. You need to do it for any network protocol that uses strings, which is most of them.