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

Comments

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Sep 9, 2019

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 label Sep 9, 2019
@TrueBrain TrueBrain added the pinned label Sep 28, 2019
LordAro added a commit to LordAro/OpenTTD that referenced this issue Oct 25, 2019
@LordAro LordAro closed this in 2f4de0a Oct 25, 2019
sdcloudt added a commit to sdcloudt/OpenTTD that referenced this issue Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.