From 465b47e632fae9bdb0f5b624e294f0f79994dd29 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 11 Jul 2016 20:03:53 +0200 Subject: Fix probable buf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/mds-message.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c index b04679a..12cdf53 100644 --- a/src/libmdsserver/mds-message.c +++ b/src/libmdsserver/mds-message.c @@ -468,9 +468,9 @@ void mds_message_marshal(const mds_message_t* restrict this, char* restrict data buf_next(data, char, n); } - memcpy(data, this->payload, this->payload_size * sizeof(char)); + memcpy(data, this->payload, this->payload_ptr * sizeof(char)); + buf_next(data, char, this->payload_ptr); - buf_next(data, char, this->payload_size); memcpy(data, this->buffer, this->buffer_ptr * sizeof(char)); } @@ -543,8 +543,8 @@ int mds_message_unmarshal(mds_message_t* restrict this, char* restrict data) this->header_count++; } - memcpy(this->payload, data, this->payload_size * sizeof(char)); - buf_next(data, char, this->payload_size); + memcpy(this->payload, data, this->payload_ptr * sizeof(char)); + buf_next(data, char, this->payload_ptr); memcpy(this->buffer, data, this->buffer_ptr * sizeof(char)); -- cgit v1.2.3-70-g09d2