-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: fix decoding base64 with whitespace #13660
Conversation
I've replaced "buffer" with "src" in the commit message since this code isn't used just for the buffer module. Any objections? |
Sorry for being so late – can you also include the patch from #13636? |
I'm having reservations about including it here, it seems barely related, and would probably confuse someone looking at the commit. Besides, that patch isn't a proper fix for the test since null char is a valid byte. The right thing would be to compare the decoded length with the expected length. |
You can totally include it as a separate commit, if that helps. (If you don’t want to include it, fine by me – but we should fix the test in any case.)
Right, good point. I’d be okay with accepting that because our expected texts don’t contain null chars, but if you have reservations I can do a PR myself. |
Right, they don't, but what if our base64_decode implementation starts erroneously padding its output with nulls? The test should fail then.
That would be great. |
Should this be backported to v6.x? |
If it applies cleanly, then yes. |
If not, we should probably still backport the test piece here. (edit: to be clear, that passes on its own on 6.11.1) |
@MylesBorins this PR fixes a bug introduced in #12146, so it depends on whether that patch was backported or not. |
opted to not land, please feel free to manually backport the test |
max_i
should also include the characters that were just read bybase64_decode_group_slow.
Fixes: #13636
Fixes: #13657
Please do review the commit message as well.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
buffer