News for hackers. Stuff that matters.
Re:Sj.h: A tiny little JSON parsing library in ~150 lines of... by boramalper on Sunday September 21, 2025 @04:09PM (#45326200)
Untrusted doesn’t always mean adversarial IMO, even a bitrot can invalidate your entire input and possibly also trigger undefined behaviour if you aren’t prepared to handle that.
Re:Sj.h: A tiny little JSON parsing library in ~150 lines of... by cwmoore on Sunday September 21, 2025 @04:19PM (#45326290)
UB = "undefined behavior", thanks
Re:Sj.h: A tiny little JSON parsing library in ~150 lines of... by leptons on Sunday September 21, 2025 @05:15PM (#45326715)
I was using a checksum to protect against "bitrot" since this was over a very noisy serial transmission line (over a slip ring). So, no, there was no "undefined behavior" and it's quite easy to avoid.