Skip to content

base64: don't drop already-decoded output when decoding hits invalid input#13314

Open
Chaganti-Reddy wants to merge 4 commits into
uutils:mainfrom
Chaganti-Reddy:base64-partial-decode-on-error
Open

base64: don't drop already-decoded output when decoding hits invalid input#13314
Chaganti-Reddy wants to merge 4 commits into
uutils:mainfrom
Chaganti-Reddy:base64-partial-decode-on-error

Conversation

@Chaganti-Reddy

Copy link
Copy Markdown
Contributor

base64 -d was throwing away everything it had already decoded whenever it hit invalid input later in the stream, instead of writing out the good prefix like GNU does. root cause was two spots that only flushed whole internal batches instead of whatever complete groups were actually buffered, plus base64's decoder rejecting a trailing group with non-canonical padding bits that GNU still accepts.

Fixes #12923

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@codspeed-hq

codspeed-hq Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 331 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing Chaganti-Reddy:base64-partial-decode-on-error (0fec3f0) with main (ff3f37d)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Chaganti-Reddy Chaganti-Reddy force-pushed the base64-partial-decode-on-error branch from 7b62903 to 0fec3f0 Compare July 8, 2026 14:05
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.

base64: Unexpected result when decoding data with garbage

1 participant