Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PL_MAX_PATH 255
- #define PL2GANFLIA_COUNTER_MAX_LENGTH PL_MAX_PATH
- char name[PL_MAX_PATH];
- int main(int argc, char *argv[]) {
- ...
- p->pl_counters_data[i].name[
- PL2GANFLIA_COUNTER_MAX_LENGTH
- ] = '\0';
- ...
- }
- This is what should have been written here: PL2GANFLIA_COUNTER_MAX_LENGTH - 1
- This suspicious code was found in iecsdk project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The '255' index is pointing beyond array bound. pl2ganglia pl2ganglia.c 1114
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment