Content deleted Content added
Project2501a (talk | contribs) {{soft-eng-stub}} |
Added the part about how gets() is OK if you check strlen() |
||
Line 8:
<!-- Please expand this article. These random notes should be changed to a more coherent article. -->
* One of the most common problems is unchecked use of constant-size structures and functions for dynamic-size data (the [[buffer overflow]] problem). This is especially common for [[string]] data in [[C programming language|C]]. C library functions like <tt>gets</tt> should never be used since the maximum size of the input buffer is not passed as an argument. (Actually, <tt>gets()</tt> can be safe in certain situations, such as where the size of the source string was verified by <tt>strlen()</tt> or similar before the call to <tt>gets</tt>.) C library functions like <tt>scanf</tt> can be used safely, but require care with the selection of safe format strings.
* Never make code more complex than necessary. Complexity breeds bugs, including security problems.
* Either leave the code available to everyone on the Net (see [[Free software]] or [[Open Source Definition]]) or hire someone who will perform a software [[security audit]].
|