From 5dd22f822df679d011622866a72ce905809e53c2 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Sat, 13 Aug 2022 15:05:23 -0400 Subject: [PATCH] fix (core): Cast sub-expression to wider-type (#12430) sub-expression may overflow before being added to a wider type. Possible fix for a segmentation fault being reported in the chat. --- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 6058b300b..f622976ec 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -94,7 +94,7 @@ InstanceSave* InstanceSaveMgr::AddInstanceSave(uint32 mapId, uint32 instanceId, } else { - resetTime = GameTime::GetGameTime().count() + 3 * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup + resetTime = GameTime::GetGameTime().count() + static_cast(3) * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup extendedResetTime = 0; } InstanceSave* save = new InstanceSave(mapId, instanceId, difficulty, resetTime, extendedResetTime);