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

Fix segfault when no USER environment variable exists #1847

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

felixfrank
Copy link
Contributor

Problem:

streq(getenv(envvar), ...) segfaults when the envvar variable does not exist because the return value of getenv is 0

Solution:

Extend the if condition with a short-circuit check of the getenv's return value

Fixes #1844

@bluca bluca merged commit 10612a1 into zeromq:master Feb 9, 2018
@bluca
Copy link
Member

bluca commented Feb 9, 2018

Thanks!

@felixfrank felixfrank deleted the getenv_fix branch February 9, 2018 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants