[MDEV-9465] The constructor StringBuffer(const char *str, size_t length, const CHARSET_INFO *cs) looks suspicious Created: 2016-01-26 Updated: 2019-04-23 Resolved: 2019-04-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.39 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The second StringBuffer constructor looks suspicious:
It calls this String() constructor:
and then calls this set():
So "ptr" does not point to StringBuffer::buff any more. This call sequence seems to have a very little sense. Perhaps it should be copy() instead of set(). |