[ODBC-392] SQLSetConnectAttr(SQL_ATTR_CURRENT_CATALOG) can work incorrectly Created: 2023-06-06  Updated: 2023-06-13  Resolved: 2023-06-13

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.18
Fix Version/s: 3.1.19, 3.2.1

Type: Bug Priority: Minor
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None


 Description   

That could be possible if the attribute value is passed with length, and not with SQL_NTS and ANSI API is used(i.e. SQLSetConnectAttr and not SQLSetConnectAttrW) . Even if the string itself is NULL-terminated, but terminating NULL is not included into string length) on Windows DM maps the call to widechar function, and while transcoding string to unicode, it uses only passed number of characters, and transcoded string could end up not NULL-terminated(actually not always, but that is more like magic).
Since nobody ever hit it - it's probably minor.


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