mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +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:
@ -398,7 +398,7 @@ bool String::copy_aligned(const char *str, size_t arg_length, size_t offset,
|
||||
DBUG_ASSERT(offset && offset != cs->mbminlen);
|
||||
|
||||
size_t aligned_length= arg_length + offset;
|
||||
if (alloc(aligned_length))
|
||||
if (alloc(aligned_length+1))
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user