News for hackers. Stuff that matters.
Re:Fix the unit test and open a giant hole everywhere by selfhoster11 on Saturday December 25, 2021 @08:33PM (#29688845)
I like the idea that Joel had: make untrusted user provided strings into a distinct data type that doesn't easily fit into the mold of a trusted, already-sanitised string type.

If you ever see an unsafe string usage being passed into a function that expects a safe string, without an accompanying call to sanitise(), that's very wrong (and won't work if the language is strongly typed) and should be recognised/corrected as such immediately.

Re:Fix the unit test and open a giant hole everywhere by taneq on Sunday December 26, 2021 @07:30AM (#29691897)
Yeah, I actually nearly put in something about separate trusted vs. untrusted types but didn't want to dilute the main point or hijack it religious wars over typed languages. :P
Re:Fix the unit test and open a giant hole everywhere by selfhoster11 on Sunday December 26, 2021 @08:15AM (#29692147)
I think there could be some ways to make it work even in untyped/dynamically typed languages, as long as they support prototypes. Or use Applications Hungarian (not Systems Hungarian!) to add this facet of type information.