fix(python): validate UID byte length in Boost.Python converter#178
Open
buligar wants to merge 3 commits intoKasperskyLab:masterfrom
Open
fix(python): validate UID byte length in Boost.Python converter#178buligar wants to merge 3 commits intoKasperskyLab:masterfrom
buligar wants to merge 3 commits intoKasperskyLab:masterfrom
Conversation
Reject Python UUID objects with invalid byte length before copying into boost::uuids::uuid and raise ValueError instead of performing unchecked memory access. Add a regression test for malformed UUID bytes in Python bindings.
artiomn
approved these changes
Apr 10, 2026
artiomn
approved these changes
Apr 10, 2026
artiomn
requested changes
Apr 10, 2026
Contributor
artiomn
left a comment
There was a problem hiding this comment.
Python test failed:
E TypeError: No registered converter was able to produce a C++ rvalue of type std::vector<unsigned char, std::allocator<unsigned char> > from this Python object of type bytes
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.
Fixes #175
Validate UUID byte length in construct() before memcpy().
Raise ValueError for malformed UUID bytes.
Add a regression test for invalid UUID byte length.