Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
8 user(s) are online (8 user(s) are browsing encyclopedia)

Members: 0
Guests: 8

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Memory corruption

Memory corruption is an inadvertant change to the state of computer memory. This occurs when a computer memory location or processor register is accidentally overwritten by a computer program due to a programming error. Most often, corruption happens as a result of the misuse of an invalid memory address.

There are some very common mistakes that cause corruption:

# Most advanced programming languages allow you to allocate and de-allocate memory units. In C (programming language), for example, a pointer can be used to represent a specific address to an memory allocation unit of memory. If a program writes a piece of data to that address that is larger than the size it was allocated for, data beyond its bounds will be overwritten . If that data was in use by some other part of the program, it would contain unexpected data when the overwritten area of memory is accessed. See Buffer overflow . # Similar results occur if a random or otherwise invalid or unallocated address is written to. Suspose you write to address a without allocating that address. (In some languages, there is no verification of whether or not this is ok, as the compiler assumes that you know what you are doing.) If, later in the code, you try to allocate a unit of memory properly, the program (unaware that you re already using a ) might return that address or something nearby. Writing data to the second address would cause the data at a to become corrupt, and appear to change randomly. # Un-allocating (commonly called freeing ) a memory address that you never actually allocated. This may or may not change the data at the address in question and once again, you would often get unexpected results.

This kind of error may crash a program immediately, or lurk undetected for years, only occasionally causing the wrong behaviour. The corrupted data may also interact with other data, spreading the corruption. In many cases, memory corruption can be the cause of security holes and aggrivate computer insecurity issues. For example, buffer overflows on the stack allow for shellcode injection and return-to-libc attacks by allowing an attacker to modify information about program flow.

Finding such bugs can be extremely difficult. Therefore, programming tools that detect such errors automatically can be invaluable.