PYTHON-5906ClosedFixed

sync receive_message raises ValueError instead of ProtocolError for OP_COMPRESSED messages with 16 < length ≤ 25

h3. *Context* receive_message (sync path) is missing the OP_COMPRESSED minimum-length guard that exists in the async PyMongoProtocol.process_header. PyMongoProtocol.process_header has the correct guard: if op_code == 2012:     if length <= 25:         raise ProtocolError(             f"Message length (\{length!r}) not longer than standard OP_COMPRESSED message header size (25)"         ) h3. *Definition of done* Add the same guard to receive_message before entering the op_code =

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
4.18.0
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.