Patent ID: 8272059

Claim:
A method for limiting malicious heap spraying by a malicious program which makes repeated requests to concatenate another copy of a character string onto an existing concatenation of copies of the character string, the method comprising the steps of: a legitimate program function repeatedly concatenating another copy of the character string onto an existing concatenation of copies of the character string in response to each of the respective repeated requests by the malicious program; a computer determining whether a total length of the copies of the character string already concatenated by the legitimate program function in response to the repeated requests of the malicious program exceeds a predetermined threshold indicative of malicious heap spraying, and if so, the computer blocking the malicious program, and if not, the computer not blocking the malicious program, and the legitimate program function further concatenating other copies of the character string onto an existing concatenation of copies of the character string in response to additional requests by the malicious program to concatenate the character string.