PVS-StudioWarnings

PVS-Studio warning V595 for TrinityCore

Nov 18th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. CreatureAI* GetAI(Creature* creature) const
  2. {
  3.   ...
  4.   Item* item = player->StoreNewItem(
  5.     dest, ITEM_TEAR_OF_GODDESS, true);
  6.   if (item && player)
  7.     player->SendNewItem(item, 1, true, false, true);
  8.   ...
  9. }
  10.  
  11. This suspicious code was found in TrinityCore project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V595 The 'player' pointer was utilized before it was verified against nullptr. Check lines: 224, 225. scripts hyjal.cpp 224
  14.  
  15. 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