Defensive programming: Difference between revisions

Content deleted Content added
m moved content to this more descriptive title
m fix list item
Line 9:
<i>Please expand this article. These random notes should be changed to a more coherent article.</i>
 
* One of the 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]].
for dynamic-size data (the [[buffer overflow]] problem). This is especially common for [[string]] data in [[C]].
You should never use functions like <tt>gets</tt> and <tt>scanf</tt>.
* Never make your code more complex than necessary. Complexity breeds bugs, including security problems.