Skip to content

Fix macOS build and getopt crash#357

Open
jimscard wants to merge 1 commit into
Aorimn:masterfrom
jimscard:fix/macos-build-and-cli-crash
Open

Fix macOS build and getopt crash#357
jimscard wants to merge 1 commit into
Aorimn:masterfrom
jimscard:fix/macos-build-and-cli-crash

Conversation

@jimscard

Copy link
Copy Markdown

Summary:

  • fix the macFUSE 3 Darwin callback signatures used by dislocker-fuse
  • terminate the getopt_long option table correctly to avoid a help-path crash

Details:
On macOS, recent macFUSE headers use Darwin-specific callback signatures for getattr and readdir, so the existing Linux-style function pointers fail to compile. This change adds Apple-specific signatures and field access while preserving existing behavior on other platforms.

The option parsing code also built the long option table without the required trailing zero entry. getopt_long could then read past the end of the array and crash even on simple invocations like dislocker-fuse -h. Using calloc for one extra zeroed entry preserves the existing options and provides the required terminator.

Validation:

  • make
  • make travis-test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant