Cpp Coding Standards/SECURITY/BuffOver

From Apache OpenOffice Wiki
< Cpp Coding Standards‎ | SECURITY
Revision as of 17:13, 14 December 2009 by B michaelsen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Check range and validity of buffers before you write into them. Always pass buffer sizes to functions. Always check buffer limits in loops, and don't rely on special markers in data that might come from the outside. Don't use functions that don't have a buffer size argument (see unsafe functions). A malicious attacker would otherwise be able to write into memory that might later directly or indirectly execute hostile code.

See also David Wheeler's excellent Secure Programming for Linux and Unix HOWTO.

Personal tools