[MDEV-19380] ASAN heap-use-after-free in Protocol::net_store_data Created: 2019-05-01 Updated: 2019-12-17 Resolved: 2019-12-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Affects Version/s: | 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.31, 10.3.22, 10.4.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alice Sherepa | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
|
| Comments |
| Comment by Varun Gupta (Inactive) [ 2019-12-10 ] | |||||||||||||
|
Patch | |||||||||||||
| Comment by Sergei Petrunia [ 2019-12-11 ] | |||||||||||||
|
Take-aways from yesterday discussion: The bug happens because of the following: Item_cache_str::cache_value() calls this:
The window function makes the passed string object (value_buff) to point to an area in a temporary table's record buffer. The cause of the problem is that Item_cache_str::cache_value returns control while Item_cache_str::value_buff is left having its pointer pointing to a string somewhere. The fix is to call value_buff.copy(). This will make the value_buff to store its string in a buffer that it owns, which will not disappear unexpectedly. | |||||||||||||
| Comment by Sergei Petrunia [ 2019-12-11 ] | |||||||||||||
|
like so:
|