Skip to content

Commit

Permalink
Fixed access to uninitalized memory found by valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi committed May 15, 2020
1 parent a7c4e85 commit 3eadb13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/sql_repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,

pos= my_b_tell(log);
if (repl_semisync_master.update_sync_header(info->thd,
(uchar*) packet->c_ptr(),
(uchar*) packet->c_ptr_safe(),
info->log_file_name + info->dirlen,
pos, &need_sync))
{
Expand All @@ -1982,7 +1982,8 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
}
}

if (need_sync && repl_semisync_master.flush_net(info->thd, packet->c_ptr()))
if (need_sync && repl_semisync_master.flush_net(info->thd,
packet->c_ptr_safe()))
{
info->error= ER_UNKNOWN_ERROR;
return "Failed to run hook 'after_send_event'";
Expand Down

0 comments on commit 3eadb13

Please sign in to comment.