PVS-StudioWarnings

PVS-Studio warning V595 for Newton Game Dynamics

Nov 18th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. void
  2. ptw32_throw (DWORD exception)
  3. {
  4.   ....
  5.   ptw32_thread_t * sp =
  6.     (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey);
  7.  
  8.   sp->state = PThreadStateExiting;
  9.  
  10.   if (exception != PTW32_EPS_CANCEL &&
  11.       exception != PTW32_EPS_EXIT)
  12.   {
  13.     exit (1);
  14.   }
  15.   ....
  16.   if (NULL == sp || sp->implicit)
  17.   ....
  18. }
  19.  
  20. This suspicious code was found in Newton Game Dynamics project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V595 The 'sp' pointer was utilized before it was verified against nullptr. Check lines: 77, 85. ptw32_throw.c 77
  23.  
  24. 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