TLDR Web Dev · OPINIONS & ADVICE

PARSE, DON'T VALIDATE AKA SOME C SAFETY TIPS

lelanthran.com8 min read

Summary from the TLDR Web Dev newsletter

Instead of repeatedly validating input throughout the system, it's better to parse untrusted input into specific, opaque data types (like `email_t` and `name_t`) at the system's boundary. This makes sure that internal functions only handle well-defined, structured data, reducing attack surfaces and preventing misuse of raw character pointers.