PVS-StudioWarnings

PVS-Studio warning V512 for OpenCV

Nov 11th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. class CV_EXPORTS CvCalibFilter
  2. {
  3.   ....
  4.   enum { MAX_CAMERAS = 3 };
  5.   int latestCounts[MAX_CAMERAS];
  6.   CvPoint2D32f* latestPoints[MAX_CAMERAS];
  7.   ....
  8. };
  9.  
  10. void CvCalibFilter::SetCameraCount( int count )
  11. {
  12.   ....
  13.   memset( latestCounts, 0, sizeof(latestPoints) );
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in OpenCV project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V512 A call of the 'memset' function will lead to overflow of the buffer 'latestCounts'. calibfilter.cpp 238
  20.  
  21. 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