Skip to content

fix corrupt completion cache detection - #1573

Open
ralphptorres wants to merge 1 commit into
Morganamilo:masterfrom
ralphptorres:fix-corrupt-completion-cache
Open

fix corrupt completion cache detection#1573
ralphptorres wants to merge 1 commit into
Morganamilo:masterfrom
ralphptorres:fix-corrupt-completion-cache

Conversation

@ralphptorres

Copy link
Copy Markdown
Contributor

The existing null byte check in update_aur_cache only detects corruption if a null byte appears in the first 1024 bytes of packages.aur. If the corrupt binary data happens to have no null in that window, the file passes validation and gets dumped raw to stdout, producing binary garbage in completions and a bash warning:

bash: warning: command substitution: ignored null byte in input

Replace the null-only check with a check for any non-printable byte (excluding newlines), since package names are plain ASCII. This reliably detects binary/corrupt cache files regardless of where null bytes fall.

Addresses the same symptom as #1553, but at the root cause rather than working around it in the shell completion script.

@ralphptorres
ralphptorres marked this pull request as draft July 5, 2026 04:11
@ralphptorres
ralphptorres marked this pull request as ready for review July 5, 2026 04:15
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