Skip to content

fix(python): validate UID byte length in Boost.Python converter#178

Open
buligar wants to merge 3 commits intoKasperskyLab:masterfrom
buligar:fix/issue-175-uuid-validation
Open

fix(python): validate UID byte length in Boost.Python converter#178
buligar wants to merge 3 commits intoKasperskyLab:masterfrom
buligar:fix/issue-175-uuid-validation

Conversation

@buligar
Copy link
Copy Markdown
Contributor

@buligar buligar commented Apr 9, 2026

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.

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.
@buligar buligar changed the title fix(python): validate UUID byte length in Boost.Python converter fix(python): validate UID byte length in Boost.Python converter Apr 9, 2026
@artiomn artiomn self-requested a review April 10, 2026 11:16
Copy link
Copy Markdown
Contributor

@artiomn artiomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@buligar buligar requested a review from artiomn April 13, 2026 15:26
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.

UID size doesn't checked

2 participants