Changeset - r26310:2cfd486a19ea
[Not reviewed]
master
0 1 0
Patric Stout - 2 years ago 2022-07-09 08:03:57
github@truebrain.nl
Fix: commands with a RoadType in their arguments were not validated properly (#9944)

Although it was checked that RoadType was not 63 (INVALID_ROADTYPE),
and all values lower than 63 are fine, it also allowed values higher
than 63. As the RoadType is a "byte", it could contain values up
to 255.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/road.cpp
Show inline comments
 
@@ -141,7 +141,7 @@ bool HasAnyRoadTypesAvail(CompanyID comp
 
 */
 
bool ValParamRoadType(RoadType roadtype)
 
{
 
	return roadtype != INVALID_ROADTYPE && HasRoadTypeAvail(_current_company, roadtype);
 
	return roadtype < ROADTYPE_END && HasRoadTypeAvail(_current_company, roadtype);
 
}
 

	
 
/**
0 comments (0 inline, 0 general)