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

Console command "alias" can stack overflow and crash (bypassing crash handler) #7969

Closed
James103 opened this issue Feb 1, 2020 · 4 comments
Closed

Comments

@James103
Copy link
Contributor

@James103 James103 commented Feb 1, 2020

Version of OpenTTD

Last tested: d7a928a-windows-win32 (Windows 7 Ultimate)

Expected result

No crash. Instead, after a set number of recursion levels, the console command aborts with an error message saying that there were too many recursions.

Actual result

The game crashes, bypassing the crash handler.

Steps to reproduce

Run any of the following sets of console commands:

alias a a
a
alias a b
alias b a
a
alias a b
alias b c
alias c ...
...
alias ... a
a
@glx22
Copy link
Contributor

@glx22 glx22 commented Feb 1, 2020

I think it would be better to not allow usage of alias a a

@LordAro
Copy link
Member

@LordAro LordAro commented Feb 1, 2020

Would also need to handle

alias a b
alias b a
@glx22
Copy link
Contributor

@glx22 glx22 commented Feb 1, 2020

yeah I was about to edit my comment when you replied

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 1, 2020

Basically needs a recursion limit during alias expansion.

glx22 added a commit to glx22/OpenTTD that referenced this issue Feb 1, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Feb 1, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Feb 4, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Feb 4, 2020
glx22 added a commit to glx22/OpenTTD that referenced this issue Feb 4, 2020
@glx22 glx22 closed this in b5d5655 Feb 4, 2020
douiwby added 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.