Repository navigation
fix(blob): reject unsupported formats during unpack - #1742
Open
godara-alt wants to merge 2 commits into
Open
godara-alt wants to merge 2 commits into
godara-alt wants to merge 2 commits into
Conversation
Preserve unknown blob format validation and regression coverage alongside upstream character-array and other fixes.
This branch has not been deployed
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.
Summary
Fixes #1703.
Fix
blob.unpacksilently returningNonewhen encountering an unknown or unsupported blob serialization format.The decoder now raises a descriptive
DataJointErrorfor invalid formats while preserving the existing behavior for legitimately serializedNonevalues.Root Cause
The existing blob decoder only processed recognized
mYmanddj0serialization headers.When an unrecognized header was encountered, execution could fall through without raising an error and implicitly return
None.This made malformed or unsupported serialized data indistinguishable from a valid serialized
Nonevalue.Changes
Validate the complete
mYm\0ordj0\0serialization header before decoding.Raise
DataJointErrorwhen an unsupported blob format is encountered.Add regression tests for empty, malformed, truncated-header, and unsupported payloads.
Verify that unknown formats inside compressed payloads are rejected.
Cover PostgreSQL-style
memoryviewinputs.Verify that
BlobCodec.decodecorrectly propagates decoding errors.Preserve valid serialized
Nonebehavior.Synchronize the branch with upstream
masterwhile retaining upstream character-array serialization improvements.Testing and Verification
Latest commit:
d7f39dc63c8fc1fbd0a34482310fd92e0593d378The branch has been synchronized with the latest upstream
Check | Result -- | -- Lint and formatting | Passed Linux unit tests | Passed Windows unit tests (Python 3.10, 3.14, 3.15) | Passed MySQL integration tests (6 configurations) | Passed Minimum dependency versions (Python 3.10) | Passedmaster, and GitHub confirms there are no merge conflicts.Final Result: All 12 upstream GitHub Actions test and lint jobs passed, with zero failures and zero pending checks.
The additional vulnerability-analysis check completed with a neutral result.
GitHub confirms the PR is conflict-free (
mergeable: true).Scope
The final changes are limited to:
src/datajoint/blob.pytests/unit/test_blob_decompression.pyNo new dependencies or unrelated modifications were introduced.
The fix preserves compatibility with existing valid blob formats and maintains the expected error behavior for corrupted or unsupported serialization headers.