Skip to content

Reject passphrase config option without argument - #697

Merged
cperciva merged 1 commit into
Tarsnap:masterfrom
Errordog2:codex/passphrase-config-needarg
Jul 10, 2026
Merged

Reject passphrase config option without argument#697
cperciva merged 1 commit into
Tarsnap:masterfrom
Errordog2:codex/passphrase-config-needarg

Conversation

@Errordog2

Copy link
Copy Markdown
Contributor

Summary

Fixes #696 by making the passphrase configuration-file option follow the same missing-argument path as other argument-requiring options.

When passphrase appears without an argument, dooption() now jumps to the existing
eedarg handler before calling passphrase_entry_parse(), avoiding the NULL dereference reported in the issue.

Validation

  • Inspected the current master implementation and confirmed passphrase was the only path here calling passphrase_entry_parse(conf_arg, ...) without a prior conf_arg == NULL guard.
  • Confirmed the PR diff is limited to ar/bsdtar.c and adds only the existing-style conf_arg == NULL / goto needarg check.

I was unable to run a local build in this environment because repeated git clone attempts to GitHub failed with network connection resets/timeouts, so I submitted the minimal patch through the GitHub API.

@Errordog2

Copy link
Copy Markdown
Contributor Author

Additional validation from this environment:

  • Downloaded the PR branch via GitHub codeload after git clone kept failing with connection resets.
  • Re-inspected ar/bsdtar.c in the downloaded source archive.
  • Confirmed the passphrase branch now checks conf_arg == NULL and jumps to the existing
    eedarg handler before passphrase_entry_parse().
  • Confirmed the branch contains the same existing missing-argument pattern used by nearby argument-requiring options.

I still cannot run the full autotools build/test suite locally here because the available WSL environment lacks the needed build tools, but the patch remains a minimal control-flow guard.

@gperciva

gperciva commented Jul 8, 2026

Copy link
Copy Markdown
Member

Closing and re-opening to trigger CI run.

@gperciva gperciva closed this Jul 8, 2026
@gperciva gperciva reopened this Jul 8, 2026
@gperciva gperciva assigned gperciva and unassigned gperciva Jul 8, 2026
@cperciva
cperciva merged commit eaf712d into Tarsnap:master Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[bug bounty] --verify-config crashes on passphrase without an argument

3 participants