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
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@James103
Copy link
Contributor

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
@nielsmh nielsmh added bug Something isn't working good first issue Good for newcomers labels Feb 1, 2020
@glx22
Copy link
Contributor

glx22 commented Feb 1, 2020

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

@LordAro
Copy link
Member

LordAro commented Feb 1, 2020

Would also need to handle

alias a b
alias b a

@glx22
Copy link
Contributor

glx22 commented Feb 1, 2020

yeah I was about to edit my comment when you replied

@nielsmh
Copy link
Contributor

nielsmh commented Feb 1, 2020

Basically needs a recursion limit during alias expansion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants