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

Segfault when $TERM is unset on Linux #174

Open
hosiet opened this issue Aug 25, 2023 · 3 comments
Open

Segfault when $TERM is unset on Linux #174

hosiet opened this issue Aug 25, 2023 · 3 comments
Labels

Comments

@hosiet
Copy link

hosiet commented Aug 25, 2023

Describe the bug

$ env -u TERM cmatrix -f
Segmentation fault

To Reproduce
See above.

Expected behavior
Program should not crash, or it should give a clear explanation before exiting gracefully.

  • OS: Debian 12

Additional context
Downstream bug report: https://bugs.debian.org/715743

@hosiet hosiet added the Bug label Aug 25, 2023
@hosiet
Copy link
Author

hosiet commented Aug 25, 2023

Referencing https://bugs.debian.org/715743#27:

I believe the culrpit is this line:

if (force && strcmp("linux", getenv("TERM"))) {

If getenv() returns NULL, then strcmp() crashes.

@AliHj98
Copy link

AliHj98 commented Aug 28, 2023

Also getting segmentation fault after a few seconds

compiling on windows 11 with WSL

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

No branches or pull requests

3 participants
@hosiet @AliHj98 and others