-
Book Overview & Buying
-
Table Of Contents
The Web Application Hacker's Handbook
By :
Integer-related vulnerabilities typically arise when an application performs some arithmetic on a length value before performing some buffer operation but fails to take into account certain features of how compilers and processors handle integers. Two types of integer bugs are worthy of note: overflows and signedness errors.
These occur when an operation on an integer value causes it to increase above its maximum possible value or decrease below its minimum possible value. When this occurs, the number wraps, so a very large number becomes very small, or vice versa.
Consider the following “fix” to the heap overflow described previously:
bool CheckLogin(char* username, char* password)
{
unsigned short len = strlen(username) + 1;
char* _username = (char*) malloc(len);
strcpy(_username, username);
...
Here, the application measures the length of the user-submitted username, adds 1 to accommodate the trailing null,...
Change the font size
Change margin width
Change background colour