mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
MDEV-28315 Fix ASAN stack-buffer-overflow in String::copy_aligned
Starting since this commit 36cdd5c3cd
there is an ASAN stack-buffer-overflow error because we append a NULL
terminator beyond the length of memory allocated.
Reviewed by: Monty and Nayuta Yanagisawa
This commit is contained in:
@ -690,7 +690,7 @@ public:
|
||||
|
||||
Note that if arg_length == Alloced_length then we don't allocate.
|
||||
This ensures we don't do any extra allocations in protocol and String:int,
|
||||
but the string will not be atomically null terminated if c_ptr() is not
|
||||
but the string will not be automatically null terminated if c_ptr() is not
|
||||
called.
|
||||
*/
|
||||
if (arg_length <= Alloced_length && Alloced_length)
|
||||
|
Reference in New Issue
Block a user