mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-10735: Valgrind warnings around Galera SST
While copying the received state Id (uuid:seqno) to an uninitialized buffer, it was not properly null-terminated.
This commit is contained in:
@@ -476,13 +476,11 @@ static void* sst_joiner_thread (void* a)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Scan state ID first followed by wsrep_gtid_domain_id.
|
// Scan state ID first followed by wsrep_gtid_domain_id.
|
||||||
char uuid[512];
|
|
||||||
unsigned long int domain_id;
|
unsigned long int domain_id;
|
||||||
size_t len= pos - out + 1;
|
|
||||||
|
|
||||||
if (len > sizeof(uuid)) goto err; // safety check
|
// Null-terminate the state-id.
|
||||||
memcpy(uuid, out, len); // including '\0'
|
out[pos - out]= 0;
|
||||||
err= sst_scan_uuid_seqno (uuid, &ret_uuid, &ret_seqno);
|
err= sst_scan_uuid_seqno (out, &ret_uuid, &ret_seqno);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user