Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

If you have the input in a buffer of known length in C, hand it off to a (dynamic or static) library written in a safe language, and get back trusted parsed output, then there's much less attack surface in your C code.


view as:

The issue in many of these cases is there appears to be no canonical safe way to know the length of the input in C, and people apparently screw up keeping track of the lengths of the buffers all the time.

This is why you reduce the amount of C code that has to keep track of it to as little as possible.

Legal | privacy