Difference between revisions of "Cpp Coding Standards/SECURITY/UnsafeFunc"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial revision)
 
m
Line 6: Line 6:
 
*when using alloca, limit the amount of memory requested, as it is bound by the stack size.
 
*when using alloca, limit the amount of memory requested, as it is bound by the stack size.
  
See also David Wheeler's excellent [http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/index.html Secure Programming for Linux and Unix HOWTO]
+
See also David Wheeler's excellent [http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/index.html Secure Programming for Linux and Unix HOWTO].

Revision as of 15:46, 1 December 2006

Don't use functions that are known to have security issues:

  • strcpy(), strcat(), gets(), sprintf(), and the scanf() family format string problems ([v][f]printf(), [v]snprintf(), and syslog())
  • race conditions (such as access(), chown(), chgrp(), chmod(), tmpfile(), tmpnam(), tempnam(), and mktemp()
  • potential shell metacharacter dangers (most of the exec() family, system(), popen())
  • poor random number acquisition, such as with random()
  • when using alloca, limit the amount of memory requested, as it is bound by the stack size.

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

Personal tools