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: check config file before accessing values #1120

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

chews93319
Copy link
Contributor

@chews93319 chews93319 commented Oct 3, 2024

Issue #, if available: N/A

Description of changes:
Adding null pointer checks for finch config file prior to attempting to access the fc.dockercompat configuration option.

According to main_native.go:45-46, in the specific scenario that the finch.yaml config fails to load due to os.ErrPermission, then a null pointer is passed to the application when initializing NerdctlCommands.
The recently introduced dependence upon the fc.DockerCompat configuration option resulted in a segmentation violation of nil pointer dereference for Finch on Linux use-case.

Testing done:

  • Manual debugger testing

  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Shubhranshu153 Shubhranshu153 marked this pull request as ready for review October 3, 2024 07:41
@Shubhranshu153 Shubhranshu153 merged commit 5a47eec into runfinch:main Oct 3, 2024
29 checks passed
@chews93319 chews93319 deleted the segfault_fcpointer branch October 3, 2024 15:14
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