[CONCPP-116] Setting parameter with setByte can crash the driver during execution Created: 2023-12-06  Updated: 2023-12-13  Resolved: 2023-12-13

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: 1.0.2, 1.1.2
Fix Version/s: 1.0.3, 1.1.3

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Depending on value Byte parameter could cause use of array index out of the range.
getByte also has problem of returning correct value in case of binary field.
This problem was reported in this PR



 Comments   
Comment by Lawrin Novitsky [ 2023-12-13 ]

The fix and testcases have been pushed. There was an error with setByte method causing crash during query execution because of wrong >> operation resulting in wrong array index.
Also, the counterpart method - getByte had error, along with all other integer getters. In case of binary data they tried to read it as a string and convert to string as integer, and thus returning wrong values

Generated at Thu Feb 08 03:08:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.