diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-07-18 20:26:05 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2016-08-20 15:51:15 +0200 |
| commit | 836fe5d1ed098e157ce3790f5ede8ac483bd2526 (patch) | |
| tree | 861db6a6d2dc05bcc7c5ae8c1e7bbd2d9434dc0f /src | |
| parent | 08b383305146962f686af716c90f10776a12bc12 (diff) | |
Core/Spells: Fixed possible null pointer dereference
Coverity CID 1357406
(cherry picked from commit cc07a491f64fa958c8a27079bd2def84c577f816)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6ab10158b3c..339b2e9b71f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12731,7 +12731,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell return 0; if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile) return spellInfo->GetMaxRange(); - if (target == NULL) + if (!target) return spellInfo->GetMaxRange(true); return spellInfo->GetMaxRange(!IsHostileTo(target)); } @@ -12742,6 +12742,8 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell return 0; if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile) return spellInfo->GetMinRange(); + if (!target) + return spellInfo->GetMinRange(true); return spellInfo->GetMinRange(!IsHostileTo(target)); } |
