Advertisement
PVS-StudioWarnings

PVS-Studio warning V595 for TinyCAD

Nov 21st, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. bool CDrawMetaFile::setImageFile(const TCHAR *filename)
  2. {
  3.   CImage *i = NULL;
  4.  
  5.   ....
  6.  
  7.   // Read in the buffer
  8.   i->SetCompressedData(buffer, bytes);
  9.  
  10.   if (i != NULL)
  11.   {
  12.     m_metafile = m_pDesign->GetOptions()->AddMetaFile(i);
  13.   }
  14.  
  15.   return i != NULL;
  16. }
  17.  
  18. This suspicious code was found in TinyCAD project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V595 The 'i' pointer was utilized before it was verified against nullptr. Check lines: 142, 144. drawmetafile.cpp 142
  21.  
  22. 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
Advertisement