diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-11 20:03:53 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-11 20:03:53 +0200 |
commit | 465b47e632fae9bdb0f5b624e294f0f79994dd29 (patch) | |
tree | 815f42832681c984b8adaf71055d40f61f58d128 | |
parent | Fix bug (diff) | |
download | mds-465b47e632fae9bdb0f5b624e294f0f79994dd29.tar.gz mds-465b47e632fae9bdb0f5b624e294f0f79994dd29.tar.bz2 mds-465b47e632fae9bdb0f5b624e294f0f79994dd29.tar.xz |
Fix probable buf
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | src/libmdsserver/mds-message.c | 8 |
1 files changed, 4 insertions, 4 deletions
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)); |