Skip to content

NULL check environ before dereference #168

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

Open
wants to merge 1 commit into
base: amd-staging
Choose a base branch
from

Conversation

dusan-exostellar
Copy link

Associated JIRA ticket number/Github issue number

Closes #164

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Continuous Integration

What were the changes?

NULL check environ before dereference.

Why are these changes needed?

To prevent dereferencing NULL pointer.

Updated CHANGELOG?

  • Yes
  • No, Does not apply to this PR.

Added/Updated documentation?

  • Yes
  • No, Does not apply to this PR.

Additional Checks

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally.
  • Any dependent changes have been merged.

@brabrzak-amd
Copy link
Contributor

Can you please change the PR to move this check outside the ifdef?

if (environ == NULL) {

@brabrzak-amd
Copy link
Contributor

One more thing, please squash the two commits together, after that lgtm

On UNIX, `clearenv` sets `environ` to NULL.
So, NULL is a valid value for `environ`.

Signed-off-by: Dušan Veljko <[email protected]>
@dusan-exostellar
Copy link
Author

One more thing, please squash the two commits together, after that lgtm

Done

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.

[Issue]: SIGSEGV during HIP initialization if environ is clearenv-ed
2 participants