When creating heartbeat packet too many bytes were copied.
The memory area ‘ptr’ points to contains now the right data
This commit is contained in:
@ -4609,13 +4609,14 @@ GWBUF *resp;
|
|||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
int len = BINLOG_EVENT_HDR_LEN;
|
int len = BINLOG_EVENT_HDR_LEN;
|
||||||
uint32_t chksum;
|
uint32_t chksum;
|
||||||
|
int filename_len = strlen(slave->binlogfile);
|
||||||
|
|
||||||
/* Add CRC32 4 bytes */
|
/* Add CRC32 4 bytes */
|
||||||
if (!slave->nocrc)
|
if (!slave->nocrc)
|
||||||
len +=4;
|
len +=4;
|
||||||
|
|
||||||
/* add binlogname to data content len */
|
/* add binlogname to data content len */
|
||||||
len += strlen(slave->binlogfile);
|
len += filename_len;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alloc buffer for network binlog stream:
|
* Alloc buffer for network binlog stream:
|
||||||
@ -4659,9 +4660,9 @@ uint32_t chksum;
|
|||||||
ptr = blr_build_header(resp, &hdr);
|
ptr = blr_build_header(resp, &hdr);
|
||||||
|
|
||||||
/* Copy binlog name */
|
/* Copy binlog name */
|
||||||
memcpy(ptr, slave->binlogfile, BINLOG_FNAMELEN);
|
memcpy(ptr, slave->binlogfile, filename_len);
|
||||||
|
|
||||||
ptr += strlen(slave->binlogfile);
|
ptr += filename_len;
|
||||||
|
|
||||||
/* Add the CRC32 */
|
/* Add the CRC32 */
|
||||||
if (!slave->nocrc)
|
if (!slave->nocrc)
|
||||||
|
Reference in New Issue
Block a user