In computer programming, buffer overflow refers to a voilation in the safety of the computer memory. Buffer basically refers to a computer memory boundary which is created during the transfer of data from one region to another. The term buffer overflow with regards to computer programming is used when the data which is written crosses the buffer to overwrite the memory adjacent to it.
The inputs of a computer program itself can be responsible for the buffer overflow. When a program has a buffer overflow, it overwrites the adjacent program leading to unpredictable behavior of the program. It might also cause memory access problems, when there is a buffer overflow in a program. The computer languages such a C program and the C++ are the ones associated with the buffer overflows. This is possible because, these programming languages do not feature a built in security system, leading to illegal access and voilation of data.
There are many techniques associated to breach the computer security due to buffer overflows. This article speaks about the protective measure that can possibly be taken, to avoid the buffer overflows in the programs. The related countermeasures to identify and to avoid buffer over flows are mentioned below: –
- The first step that can be taken to avoid the buffer overflows is by choosing the right programming language to develop the program. The use of interpreted languages for computer programming is recommended as they offer protection against buffer overflow, with the help of runtime checking. Some of the interpreted languages include Ada, Module-2 and others.
- To avoid the buffer overflows, it is recommended to use safe libraries. The buffer overflow in programs can be corrected with the right buffer managment. The codes used in the program should be accurate. Regular library functions should be avoided as they are not checked for bounds. Thus, with the use of safe library functions like ‘Better String Library’ or ‘Erwin’ can be used for safe programming.
- The main reason for the buffer overflow is because of the pointers used in the programs. The use of point guard which are developed lately in the programmes, avoids the buffer overflows. The work of the point guard is to avoid the hackers to manipulate the stored addresses in the programs and thus preventing the buffer overflows. Other companies make use of the API protection instead of point gaurd for better computer security.
- The use of buffer overflow protection can help in avoiding the buffer overflows to a major extent. This checks the buffer overflows in a program on a regular basis to identify if any changes has been made to the function when it returns. The protection of the program can be strengthned by splitting the stacks present in the program to two parts.
- The buffer over flows can also be reduced by arranging the stored addresses in a particular format. This is known as address space layout randomization..
Thus byfollowing these countermeasures, the buffer overflows of a program can be successfully avoided and computer security of the network or the program can be enhanced.