Secure coding: Difference between revisions

Content deleted Content added
m Buffer-overflow prevention: formating fix(es), replaced: ,''''' → ''''',
Tag: Reverted
Line 10:
 
== Buffer-overflow prevention ==
[[Buffer overflow]]s, a common software security vulnerability, happen when a process tries to store data beyond a fixed-length buffer. For example, if there are 8 slots to store items in, there will be a problem if there is an attempt to store 9 items. In computer memory the overflowed data may overwrite data in the next ___location which can result in a security vulnerability (stack smashing) or program termination (segmentation fault).<ref name="bss2001"/>
 
An example of a [[C (programming language)|C]] program prone to a buffer overflow is<syntaxhighlight lang="c++">