From 2ca46ec636bef771616be789a538739199a4637f Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 16 Apr 2017 20:11:54 +0200 Subject: [PATCH] fixed bug in serialization of data chunks --- libretroshare/src/serialization/rstypeserializer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/serialization/rstypeserializer.cc b/libretroshare/src/serialization/rstypeserializer.cc index 2c68d2c0c..64ba46f68 100644 --- a/libretroshare/src/serialization/rstypeserializer.cc +++ b/libretroshare/src/serialization/rstypeserializer.cc @@ -213,6 +213,7 @@ template<> bool RsTypeSerializer::deserialize(const uint8_t data[],uint32_t size ok = ok && NULL != r.first; memcpy(r.first,&data[offset],r.second) ; + offset += r.second ; if(!ok) offset = saved_offset ; @@ -227,6 +228,7 @@ template<> bool RsTypeSerializer::serialize(uint8_t data[],uint32_t size,uint32_ bool ok = serialize(data,size,offset,r.second) ; memcpy(&data[offset],r.first,r.second) ; + offset += r.second ; if(!ok) offset = saved_offset ;