PVS-StudioWarnings

PVS-Studio warning V595 for Coin3D

Nov 20th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. SbBool
  2. SoBaseKit::setPart(const int partnum, SoNode * node)
  3. {
  4.   ....
  5.   if (childlist->find(node) >= 0) {
  6.     SoDebugError::postWarning("SoBaseKit::setPart",
  7.       "Node pointer (%p, '%s', '%s') is "
  8.       "already used under the same group node in the catalog "
  9.       "as a child of part '%s' -- this is not allowed",
  10.       node,
  11.       node->getName().getString(),
  12.       node->getTypeId().getName().getString(),
  13.       catalog->getName(parentIdx).getString());
  14.     return FALSE;
  15.   }
  16.   ....
  17.   if (node)
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in Coin3D project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V595 The 'node' pointer was utilized before it was verified against nullptr. Check lines: 2397, 2407. sobasekit.cpp 2397
  24.  
  25. 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