Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow with more than 255 orders per vehicle #2495

Closed
DorpsGek opened this issue Jan 4, 2009 · 1 comment
Closed

Overflow with more than 255 orders per vehicle #2495

DorpsGek opened this issue Jan 4, 2009 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jan 4, 2009

Swallow opened the ticket and wrote:

Currently a VehicleOrderID is a byte, so it cannot be higher than 255. This limit, however, is not enforced anywhere. This leads to an overflow of OrderList->num_orders. An order count of exactly 255 could be even worse, as it marks the Orderlist as invalid.

The attached patch fixes this by adding a check in CmdInsertOrder, which limits the number of orders to 254 (INVALID_VEH_ORDER_ID - 1)

I can't see why anyone would ever add so many orders, but I think it's better to have this fixed.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2495
@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 4, 2009

Rubidium closed the ticket.

Reason for closing: Fixed

In r14830


This comment was imported from FlySpray: https://bugs.openttd.org/task/2495

@DorpsGek DorpsGek closed this as completed Jan 4, 2009
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant