#21 array index out of bounds

closed-out-of-date
nobody
None
5
2010-03-11
2009-06-28
orbitcowboy
No

Hello,

i have checked the sources of kprof -1.4.3 with a static code analysis tool (cppcheck).
It brought up an issue. The tool prints the following output:

[kprof/kprof/Log.cpp:222]: (all) Array index out of bounds

Take a look at the sourcecode:

char pos[30];
snprintf(pos, sizeof(pos)-1, "%15s(%4d) ", file, line);
pos[sizeof(pos)]=0;

Indeed, the index of array-variable pos goes out of bounds

Best regards

Martin

Discussion

    • status: open --> closed-out-of-date