Merge pull request #11718 from MegaMech/patch-1

Added check to prevent overflow assertion error
This commit is contained in:
Duncan authored and GitHub committed 2020-05-13 07:58:02 +01:00
commit f04f62305d
2 files changed
+10

No files matched your search

+9
View File
@@ -78,6 +78,15 @@ public:
return res;
}
if (_status >= RIDE_STATUS_COUNT)
{
log_warning("Invalid ride status %u for ride %u", uint32_t(_status), uint32_t(_rideIndex));
res->Error = GA_ERROR::INVALID_PARAMETERS;
res->ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res->ErrorMessage = STR_NONE;
return res;
}
res->ErrorTitle = _StatusErrorTitles[_status];
ride->FormatNameTo(res->ErrorMessageArgs.data() + 6);
if (_status != ride->status)
+1
View File
@@ -630,6 +630,7 @@ enum
RIDE_STATUS_OPEN,
RIDE_STATUS_TESTING,
RIDE_STATUS_SIMULATING,
RIDE_STATUS_COUNT,
};
enum : uint8_t