Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void WINAPI _GetMonitorRectByIndex( int iMonitor, RECT* pRect )
- {
- int iMonitorCount = ::GetSystemMetrics( SM_CMONITORS );
- if ( iMonitor <= iMonitorCount || pRect != NULL ) <<<---
- {
- if ( iMonitorCount == 1 )
- {
- pRect->left = 0;
- pRect->top = 0;
- pRect->right = GetSystemMetrics( SM_CXSCREEN );
- pRect->bottom = GetSystemMetrics( SM_CYSCREEN );
- }
- ...
- }
- else
- {
- pRect->left = -1; <<<---
- pRect->top = -1;
- pRect->right = -1;
- pRect->bottom = -1;
- }
- }
- This suspicious code was found in GeoLib project by PVS-Studio static code analyzer.
- Warning message is:
- V522 Dereferencing of the null pointer 'pRect' might take place. geOLib geolib.cpp 3282
- 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