Advertisement
PVS-StudioWarnings

PVS-Studio warning V600 for MTASA

Nov 25th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. int CLuaFunctionDefs::GetPlayerSerial ( lua_State* luaVM )
  2. {
  3.   char szSerial [ 64 ];
  4.   g_pCore->GetNetwork()->GetSerial(szSerial, sizeof(szSerial));
  5.  
  6.   if ( szSerial )
  7.   {
  8.     lua_pushstring ( luaVM, szSerial );
  9.     return 1;
  10.   }
  11.  
  12.   lua_pushboolean ( luaVM, false );
  13.   return 1;
  14. }
  15.  
  16. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V600 Consider inspecting the condition. The 'szSerial' pointer is always not equal to NULL. cluafunctiondefs.player.cpp 508
  19.  
  20. 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