This applet demonstrates the buffer overflow problem in C language. This applet consists largely of three panels to support your understanding of buffer overflow.

The left side of the applet consists of the code panel. This panel will walk you through the sample C code with potential buffer overflow occurrences. It shows the C code that you are going to run. By clicking on the "Step" button you can run the program step-by-step, or run it at once by clicking on the "Run" button. The "Restart" button will bring you back at the beginning of the program. There are five text fields in the code which allow you to change the values of different variables in different steps.

The top right area of the applet consists of the memory panel. The memory columns makes you aware of the happenings in the memory leading to a buffer overflow. By changing the values of the variables in the text boxes on left side, you can visually observe the different situations where buffer overflow occurs. For example, if the character array 'line' is assigned to a string with more than 10 characters at the second 'strcpy' statement, the integer variable 'j' is changed because some bytes of its memory are overflowed. You can also find out which bytes are overflowed by reading the value of 'j' shown in the memory table on right hand side of the applet.

The bottom right area of the applet consists of an text area to output the results of the sample code.