server
server copied to clipboard
Extract some of #3360 fixes to 10.5.x
- ~~The Jira issue number for this PR is: MDEV-21978~~
- To clarify, my coding period for Google Summer of Code (GSoC) 2024 ended. While this code originates from my GSoC project, this publication (i.e., commit and PR descriptions) isn’t.
Description
#3360 uncovered countless potential minor security vulnerabilities on my_snprintf uses.
This commit ports a squashed subset of their fixes according to the bug-fixing process to 10.5, our oldest maintained version.
(My GSoC mentor said that they aren’t much of a problem and I can open a PR normally.)
Most size_ts were still simple uints back here, though I didn’t include their changes from %d to %u so this commit doesn’t conflict when merging up. The exception is sql/table.cc with its large chuncks of diffs from reformatting.
After all, I expect users to upgrade to the newer versions sooner or later.
Similarly, while 10.5 may have had other issues in this category that are obsolete in 11.6 (the branch from which the superset was based on), I am not goïng to hunt them down.
Release Notes
~~Nothing? These internal corrections shouldn’t be user-visible (other than perhaps one fewer crashes).~~
- Fixed data size mismatches that were garbling outputs (or possibly even crashes) on problematic platforms – mostly on error messages and debug logs
How can this PR be tested?
I’m not certain how we could catch these human errors besides testing #3360 (MDEV-21978) and syncing this PR with it.
Basing the PR against the correct MariaDB version
- This is a new feature or a refactoring, and the PR is based against the
mainbranch. - [x] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.