...
When the following program is compiled and run with GCC 4.4.3 on Linux, the value of i
is 5, as if the getlen()
function returned 5, causing an out-of-bounds write to the data
array:
...
MSC37-EX1: According to the C Standard, subclause 5.1.2.2.3, paragraph 1 [ISO/IEC 9899:2011], "reaching the }
that terminates the main function returns a value of 0." As a result, it is permissible for control to reach the end of the main
function ()
function without executing a return statement.
...