fix: guard against undef in deBase64 and stale $1 in deQP#52
Open
toddr-bot wants to merge 1 commit into
Open
Conversation
…extract_qp() deBase64::doit() crashed with uninitialized warnings when extract_base64() returned undef (e.g., base64 header present but no body separator). Added early return guard. deQP::extract_qp() returned stale $1 from the outer regex when the inner body-separator regex failed, producing wrong data. Wrapped in proper if check. Also changed bare 'return undef' to 'return' for context safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
@toddr-bot ask does this new code create a bypass that wasn't previously present? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix two latent bugs in the preprocessor extraction methods.
Why
deBase64::doit()crashes with uninitialized warnings whenextract_base64()returns undef — happens when the base64 header is present but no body separator follows (truncated email).deQP::extract_qp()returns stale$1from the outer regex when the inner body-separator match fails, silently returning wrong data instead of undef.Both are the same class of bug: unchecked return values from regex operations on malformed input.
How
return unless defined $bodyguard indeBase64::doit()after theextract_base64()call.deQP::extract_qp()with a properifcheck so$1is never stale. Changedreturn undefto barereturnfor list-context safety.Testing
t/preproc.tcovering the undef/stale-$1 edge cases.🤖 Generated with Claude Code
Quality Report
Changes: 3 files changed, 43 insertions(+), 3 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline