mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fixed Bug #5492 "set @@session.read_rnd_buffer_size=33554432"
crashes server on query incremented size of allocated buffer in the init_rr_cache(sql/records.cc) ( We are going to read the last three bytes of the buffer via uint3korr This macro reads actually 4 bytes (for speed) So, we have to allocate one more byte at the end of the buffer to avoid memory assertion fault )
This commit is contained in:
parent
38f462ae6f
commit
e58c9579fe
1 changed files with 7 additions and 1 deletions
|
@ -249,9 +249,15 @@ static int init_rr_cache(READ_RECORD *info)
|
|||
rec_cache_size=info->cache_records*info->reclength;
|
||||
info->rec_cache_size=info->cache_records*info->ref_length;
|
||||
|
||||
/*
|
||||
We are going to read the last three bytes of the buffer via uint3korr
|
||||
This macro reads actually 4 bytes (for speed)
|
||||
So, we have to allocate one more byte at the end of the buffer
|
||||
to avoid memory assertion fault
|
||||
*/
|
||||
if (info->cache_records <= 2 ||
|
||||
!(info->cache=(byte*) my_malloc_lock(rec_cache_size+info->cache_records*
|
||||
info->struct_length,
|
||||
info->struct_length+1,
|
||||
MYF(0))))
|
||||
DBUG_RETURN(1);
|
||||
#ifdef HAVE_purify
|
||||
|
|
Loading…
Reference in a new issue