[MDEV-27219] Some error messages might report table names incorrectly on LLP64 platforms Created: 2021-12-10  Updated: 2023-09-29  Resolved: 2023-09-29

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6.2, 10.6.3, 10.6.4, 10.6.5
Fix Version/s: 10.6.6, 10.10.1

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: regression-10.6
Environment:

LLP64 (e.g., 64-bit Microsoft Windows)


Issue Links:
Problem/Incident
is caused by MDEV-25743 Unnecessary copying of table names in... Closed

 Description   

MDEV-25743 added some more use of the printf-style format "%.*s" that expects the length of a string as int and a pointer to the start of the string. Some calls were passing the return value of std::string::size() as the length parameter, although that length is size_t. On 64-bit platforms that follow the LLP64 convention (such as 64-bit Microsoft Windows), sizeof(int)<sizeof(size_t) and incorrect code could be emitted, at least in theory.

I am not aware of any real issue due to this.

Note: the sign mismatch (int is signed and size_t is unsigned) should not be an issue, because we assume that the target architecture uses 2’s complement arithmetics and that sizeof(int)>=4. Any strings that are being output should be much smaller than 2 gigabytes.


Generated at Thu Feb 08 09:51:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.