Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void on_remove_app_click(HWND dialog)
- {
- ....
- section[strlen(section)] = '\0'; /* remove last backslash */
- ....
- }
- NULL is written to NULL. Backslash will not be removed.
- This suspicious code was found in Wine project by PVS-Studio static code analyzer.
- Warning message is:
- V692 An inappropriate attempt to append a null character to a string. To determine the length of a string by 'strlen' function correctly, a string ending with a null terminator should be used in the first place. appdefaults.c 390
- 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