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

Bug in extracting .tar file #6969

Closed
RailwAI opened this issue Nov 15, 2018 · 2 comments
Closed

Bug in extracting .tar file #6969

RailwAI opened this issue Nov 15, 2018 · 2 comments

Comments

@RailwAI
Copy link

@RailwAI RailwAI commented Nov 15, 2018

When in OpenTTD the AI RailwAI (version 8 or version 9) is downloaded from BaNaNaS, OpenTTD seems to incorrectly extracts the downloaded .tar file. Specifically: the file shippathfinder.nut gets an additional 3 bytes appended. Because the tar file doesn't have zero-padding here, the characters "Rai" are added, that are part of the folder/filename for the next file in the .tar file.
Extracting the downloaded .tar file with any extraction software (I use 7-zip) and put the files in the ai-folder gives the correct version of the AI. Thus, it is clearly a bug in openTTD that needs to be solved.

Note that I'll give the AI an update (version 10), hoping to work around this issue. For reproducing the bug, one can download version 9 and put it manually in the content_download folder.

LordAro added a commit to LordAro/OpenTTD that referenced this issue Nov 15, 2018
@LordAro
Copy link
Member

@LordAro LordAro commented Nov 15, 2018

An impressive find! This bug was only triggered because shippathfinder.nut is an exact multiple of 512 bytes in size and has a (3 byte) BOM, which was not being accounted for. A single byte longer and the tar file would've added another 512 bytes of padding and no one would've noticed :)

LordAro added a commit to LordAro/OpenTTD that referenced this issue Nov 15, 2018
LordAro added a commit to LordAro/OpenTTD that referenced this issue Nov 15, 2018
@RailwAI
Copy link
Author

@RailwAI RailwAI commented Nov 16, 2018

Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants