1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix #9701: GetRideEntry nullptr can cause stack overflow (#9702)

GetName calls GetRideEntry so we can't log the name of the ride. I don't think the log is necessary as we now assume rides can have a null ride entry and all callers should check for this.
This commit is contained in:
Ted John
2019-08-01 22:42:39 +01:00
committed by Michael Steenbeek
parent e4ba170c87
commit fcc41b4647

View File

@@ -255,13 +255,7 @@ void get_ride_entry_name(char* name, int32_t index)
rct_ride_entry* Ride::GetRideEntry() const
{
rct_ride_entry* rideEntry = get_ride_entry(subtype);
if (rideEntry == nullptr)
{
auto rideName = GetName();
log_error("Invalid ride subtype for ride %s", rideName.c_str());
}
return rideEntry;
return get_ride_entry(subtype);
}
/**