[MDEV-28646] Binary_string::alloc allocates redundant 1 byte for a terminator Created: 2022-05-23 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Norio Akagi | Assignee: | Michael Widenius |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
This was found during the investigation of Here However inside `Binary_string::realloc_raw` it increments the length passed in: Therefore the 1st increment should not be necessary. That being said, when I tried omitting the `+1` part I saw a test failure.
So there has to be an issue related this part. For now, I left this part as it is because there seems to be no prominent error observed and adding one extra byte should no harm. I am cutting this ticket for future research. The change was introduced in this commit commit 36cdd5c3cdb06d8538f64c0b312ffe4672a92e75 Optimize usage of c_ptr(), c_ptr_quick() and String::alloc() |