From 1f78afead98b76beabc0964e2d0912101434caee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 27 Mar 2017 22:09:46 +0200 Subject: [PATCH] Prevent dereferencing null map element in footpath_remove_real No network version increase as the client would simply crash if it were NULL. --- src/openrct2/world/footpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/footpath.c b/src/openrct2/world/footpath.c index 6b19f76d97..52d5ebc046 100644 --- a/src/openrct2/world/footpath.c +++ b/src/openrct2/world/footpath.c @@ -453,7 +453,7 @@ money32 footpath_remove_real(sint32 x, sint32 y, sint32 z, sint32 flags) bool isNotOwnedByPark = (flags & (1 << 5)); bool moneyDisabled = (gParkFlags & PARK_FLAGS_NO_MONEY); - bool isGhost = map_element_is_ghost(mapElement); + bool isGhost = (mapElement == NULL) || (map_element_is_ghost(mapElement)); if (isNotOwnedByPark || moneyDisabled || isGhost) { cost = 0;