Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int
- datasource_to_index(svn_diff_datasource_e datasource)
- {
- switch (datasource)
- {
- ....
- }
- return -1;
- }
- static svn_error_t *
- token_compare(....)
- {
- ....
- int idx = datasource_to_index(file_token[i]->datasource);
- file[i] = &file_baton->files[idx];
- ....
- }
- This suspicious code was found in TortoiseGIT project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array underrun is possible. The value of 'idx' index could reach -1. diff_file.c 1052
- 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