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

Null pointer dereference in RemoveDockingTile when adjacent to industry #7733

Closed
JGRennison opened this issue Sep 9, 2019 · 0 comments
Closed
Assignees
Labels
regression It used to work, and now it's broken.

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

Since f538179

Expected result

No null pointer dereference

Actual result

Null pointer dereference when RemoveDockingTile is called on a tile directly adjacent to an industry tile without an associated neutral station

Steps to reproduce

Clear a docking tile directly adjacent to an industry tile without an associated neutral station
See: Docking Tile Removal Bug Ltd, 1945-01-17.sav.zip

In RemoveDockingTile:

		} else if (IsTileType(tile, MP_INDUSTRY)) {
			UpdateStationDockingTiles(Industry::GetByTile(tile)->neutral_station);
		}

Industry::GetByTile(tile)->neutral_station` is null in this case and UpdateStationDockingTiles requires a non-null pointer

@JGRennison JGRennison changed the title RemoveDockingTile NUll pointer dereference in RemoveDockingTile when adjacent to industry Sep 9, 2019
@JGRennison JGRennison changed the title NUll pointer dereference in RemoveDockingTile when adjacent to industry Null pointer dereference in RemoveDockingTile when adjacent to industry Sep 9, 2019
@LordAro LordAro added the regression It used to work, and now it's broken. label Sep 9, 2019
LordAro added a commit to LordAro/OpenTTD that referenced this issue Oct 25, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression It used to work, and now it's broken.
Projects
None yet
Development

No branches or pull requests

4 participants