zm_monitor: fix overlap in memcpy buffers

behavior undefined by POSIX and causes a crash with FORTIFY_SOURCE
This commit is contained in:
Kaarle Ritvanen 2016-02-16 11:47:49 +02:00
parent f9b3287539
commit 6332f28c53
1 changed files with 1 additions and 1 deletions

View File

@ -3981,7 +3981,7 @@ void MonitorStream::processCommand( const CmdMsg *msg )
DataMsg status_msg;
status_msg.msg_type = MSG_DATA_WATCH;
memcpy( &status_msg.msg_data, &status_data, sizeof(status_msg.msg_data) );
memcpy( &status_msg.msg_data, &status_data, sizeof(status_data) );
int nbytes = 0;
if ( (nbytes = sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) )) < 0 )
{