Cpp Coding Standards/SECURITY/BuffOver

From Apache OpenOffice Wiki
< Cpp Coding Standards‎ | SECURITY
Revision as of 15:50, 1 December 2006 by Thorsten (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 SECURITY:NoUnsafeFunctions). 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