<s>
Memory	B-General_Concept
corruption	I-General_Concept
occurs	O
in	O
a	O
computer	B-Application
program	I-Application
when	O
the	O
contents	O
of	O
a	O
memory	B-General_Concept
location	I-General_Concept
are	O
modified	O
due	O
to	O
programmatic	O
behavior	O
that	O
exceeds	O
the	O
intention	O
of	O
the	O
original	O
programmer	B-Application
or	O
program/language	O
constructs	O
;	O
this	O
is	O
termed	O
as	O
violation	O
of	O
memory	B-Application
safety	I-Application
.	O
</s>
<s>
The	O
most	O
likely	O
causes	O
of	O
memory	B-General_Concept
corruption	I-General_Concept
are	O
programming	B-Error_Name
errors	I-Error_Name
(	O
software	B-Error_Name
bugs	I-Error_Name
)	O
.	O
</s>
<s>
Nearly	O
10%	O
of	O
application	O
crashes	O
on	O
Windows	O
systems	O
are	O
due	O
to	O
heap	B-General_Concept
corruption	I-General_Concept
.	O
</s>
<s>
Modern	O
programming	O
languages	O
like	O
C	B-Language
and	O
C++	B-Language
have	O
powerful	O
features	O
of	O
explicit	O
memory	O
management	O
and	O
pointer	O
arithmetic	O
.	O
</s>
<s>
However	O
,	O
using	O
these	O
features	O
incorrectly	O
may	O
lead	O
to	O
memory	B-General_Concept
corruption	I-General_Concept
errors	O
.	O
</s>
<s>
Memory	B-General_Concept
corruption	I-General_Concept
is	O
one	O
of	O
the	O
most	O
intractable	O
class	O
of	O
programming	B-Error_Name
errors	I-Error_Name
,	O
for	O
two	O
reasons	O
:	O
</s>
<s>
The	O
source	O
of	O
the	O
memory	B-General_Concept
corruption	I-General_Concept
and	O
its	O
manifestation	O
may	O
be	O
far	O
apart	O
,	O
making	O
it	O
hard	O
to	O
correlate	O
the	O
cause	O
and	O
the	O
effect	O
.	O
</s>
<s>
Memory	B-General_Concept
corruption	I-General_Concept
errors	O
can	O
be	O
broadly	O
classified	O
into	O
four	O
categories	O
:	O
</s>
<s>
Using	O
uninitialized	B-Error_Name
memory	I-Error_Name
:	O
Contents	O
of	O
uninitialized	B-Error_Name
memory	I-Error_Name
are	O
treated	O
as	O
garbage	O
values	O
.	O
</s>
<s>
If	O
such	O
a	O
pointer	O
is	O
a	O
null	O
pointer	O
,	O
dangling	B-Error_Name
pointer	I-Error_Name
(	O
pointing	O
to	O
memory	O
that	O
has	O
already	O
been	O
freed	O
)	O
,	O
or	O
to	O
a	O
memory	B-General_Concept
location	I-General_Concept
outside	O
of	O
current	O
stack	O
or	O
heap	O
bounds	O
,	O
it	O
is	O
referring	O
to	O
memory	O
that	O
is	O
not	O
then	O
possessed	O
by	O
the	O
program	O
.	O
</s>
<s>
Using	O
memory	O
beyond	O
the	O
memory	O
that	O
was	O
allocated	O
(	O
buffer	B-General_Concept
overflow	I-General_Concept
)	O
:	O
If	O
an	O
array	O
is	O
used	O
in	O
a	O
loop	O
,	O
with	O
incorrect	O
terminating	O
condition	O
,	O
memory	O
beyond	O
the	O
array	O
bounds	O
may	O
be	O
accidentally	O
manipulated	O
.	O
</s>
<s>
Buffer	B-General_Concept
overflow	I-General_Concept
is	O
one	O
of	O
the	O
most	O
common	O
programming	O
flaws	O
exploited	O
by	O
computer	O
viruses	O
,	O
causing	O
serious	O
computer	O
security	O
issues	O
(	O
e.g.	O
</s>
<s>
return-to-libc	B-Language
attack	I-Language
,	O
stack-smashing	O
protection	O
)	O
in	O
widely	O
used	O
programs	O
.	O
</s>
<s>
Faulty	O
heap	O
memory	O
management	O
:	O
Memory	B-Error_Name
leaks	I-Error_Name
and	O
freeing	O
non-heap	O
or	O
un-allocated	O
memory	O
are	O
the	O
most	O
frequent	O
errors	O
caused	O
by	O
faulty	O
heap	O
memory	O
management	O
.	O
</s>
<s>
Many	O
memory	B-General_Concept
debuggers	I-General_Concept
such	O
as	O
Purify	B-General_Concept
,	O
Valgrind	B-Application
,	O
Insure++	B-General_Concept
,	O
Parasoft	B-Library
C/C	I-Library
++test	I-Library
,	O
AddressSanitizer	B-Application
are	O
available	O
to	O
detect	O
memory	B-General_Concept
corruption	I-General_Concept
errors	O
.	O
</s>
