Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char **argv) {
- ...
- char salt[3];
- ...
- salt[0] = (argc>2)?(argv[1][0]):rndChar[rand() % 64];
- salt[1] = (argc>2)?(argv[1][1]):rndChar[rand() % 64];
- salt[3] = 0;
- ...
- }
- This is what should have been written here: salt[2] = 0;
- This suspicious code was found in TPP project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The '3' index is pointing beyond array bound. crypt crypt.cxx 567
- 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