diff options
author | Strangerke | 2016-09-12 21:19:52 +0200 |
---|---|---|
committer | Strangerke | 2016-09-12 21:19:52 +0200 |
commit | db3ba8ecc03052a463e3f4d757c3efd4cb604994 (patch) | |
tree | a363a72cd5bec56199897cdd45197ec2a231a5c7 /engines/dm | |
parent | 2aada126a254628a3eda6d14788bb6131fe41985 (diff) | |
download | scummvm-rg350-db3ba8ecc03052a463e3f4d757c3efd4cb604994.tar.gz scummvm-rg350-db3ba8ecc03052a463e3f4d757c3efd4cb604994.tar.bz2 scummvm-rg350-db3ba8ecc03052a463e3f4d757c3efd4cb604994.zip |
DM: Avoid null pointer dereferencing in unlinkThingFromList
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/dungeonman.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 4e7dd9d8cd..74979850ef 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -1584,7 +1584,8 @@ void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int Thing currThing = getNextThing(thingInList); while (currThing.getTypeAndIndex() != thingToUnlink.toUint16()) { if ((currThing == Thing::_endOfList) || (currThing == Thing::_none)) { - *thingPtr = Thing::_endOfList; + if (thingPtr) + *thingPtr = Thing::_endOfList; return; } currThing = getNextThing(thingInList = currThing); |