[SERVER-23710] BinDataType numeric values must be handled as unsigned char Created: 14/Apr/16  Updated: 26/Apr/16  Resolved: 15/Apr/16

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: undefined-sanitizer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Run the aggregation framework unit tests under the undefined behavior sanitizer.

Sprint: Platforms 13 (04/22/16)
Participants:

 Description   

Value::deserializeForSorter reads a byte from a buffer as a char, which may be signed, and then uses that char to construct a BinDataType value, which is implicitly an int. Since the largest BinDataType value is 128, the value must actually be handled as an unsigned char.

The same error exists in JParse::binaryObject.



 Comments   
Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-16221 SERVER-23710 Result of fromHex must be cast before becoming a BinDataType
Branch: master
https://github.com/mongodb/mongo/commit/177d955e1e47535141edfb6205ba8fd7004b2aa2

Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-16221 SERVER-23710 BinDataType should be read as unsigned in Value
Branch: master
https://github.com/mongodb/mongo/commit/c1fcce5c1e5ed72c634c5a6d0deaa373b1960839

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