Patent ID: 7434020

Claim:
A method for providing overwrite detection for an allocable memory block, comprising: receiving a request for performing one of requesting the allocable memory block, requesting the size of the allocable memory block, and freeing the allocable memory block; performing a checksum on the allocable memory block; storing results of the checksum within the allocable memory block; generating an overwrite detection pattern for the allocable memory block based on a size of an area of the allocable memory block that is used for alignment purposes, wherein the area includes a number of memory units each including a plurality of bytes; a predetermined code is generated for one or more of the bytes in each of the memory units so that a change in the predetermined numeric code in one or more of the bytes of one or more of the memory units indicates a memory overwrite; and the predetermined code generated for the one or more bytes in each of the one or more memory units is different for each of the memory units; storing the overwrite detection pattern in the area of the allocable memory block used for alignment purposes, wherein the overwrite detection pattern is stored separately from the results of the checksum in the allocable memory block; checking the overwrite detection pattern; and forcing an access violation if one of the checksum is not valid and the overwrite detection pattern has been modified.