Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int encodings[] = {
- 1250,
- 1251,
- 1252,
- ....
- };
- BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(
- UINT Message, WPARAM wParam, LPARAM)
- {
- ...
- for (int i = 0 ; i <= sizeof(encodings)/sizeof(int) ; i++)
- {
- int cmdID = em->getIndexFromEncoding(encodings[i]);
- ...
- }
- This is what should have been written here: i < sizeof(encodings)/sizeof(int)
- This suspicious code was found in Notepad++ project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i' index could reach 46. Notepad++ preferencedlg.cpp 984
- 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