[CSHARP-2760] All binary message encoders should verify the opcode when decoding a message Created: 27/Sep/19  Updated: 28/Oct/23  Resolved: 06/Feb/20

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.11.0
Fix Version/s: 2.11.0

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Mikalai Mazurenka (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-2672 Fix snappy compression Closed

 Description   

A few of the binary message encoders skip over the opcode while decoding a message without verifying that the opcode has the expected value.

They should throw an exception if the opcode does not have the expected value.



 Comments   
Comment by Githook User [ 06/Feb/20 ]

Author:

{'username': 'MikalaiMazurenka', 'name': 'Mikalai Mazurenka', 'email': 'mikalai.mazurenka@mongodb.com'}

Message: CSHARP-2760: All binary message encoders should verify the opcode when decoding a message
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/fc75cb4192e1da2124f24ad9fdbb00af07c91239

Comment by Robert Stam [ 27/Sep/19 ]

If the decoder for OP_REPLY had thrown an exception when the opcode was not valid it would have been much easier to find a lurking issue with compression against 3.4.

Generated at Wed Feb 07 21:43:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.