[SERVER-33750] ASIO's socket_ops::sync_send must never return a negative value Created: 08/Mar/18  Updated: 29/Oct/23  Resolved: 09/Mar/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Bug Priority: Major - P3
Reporter: Jonathan Reams Assignee: Jonathan Reams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2018-03-12
Participants:
Linked BF Score: 81

 Description   

socket_ops::sync_send captures information about errors in a std::error_code, and apparently ASIO doesn't check that value before it adds the return value (number of bytes sent) to its count of bytes sent already. If sync_send returns -1 (because of an error), it will end up adding that to its count and then resend a byte which corrupts the message.



 Comments   
Comment by Githook User [ 09/Mar/18 ]

Author:

{'email': 'jbreams@mongodb.com', 'name': 'Jonathan Reams', 'username': 'jbreams'}

Message: SERVER-33750 ASIO's socket_ops::sync_send must never return a negative value
Branch: master
https://github.com/mongodb/mongo/commit/dec9b8f5f4b60b8f29244ecdfd759b6141aa7d34

Generated at Thu Feb 08 04:34:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.