From 2139090f5dbade21422d8700b968c0cce9ef5d3b Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 9 Oct 2018 22:43:15 +0200 Subject: [PATCH] Fix bug in JSON t_RsFlags32 deserialization If the member was not present in the JSON it was zeroed while it should be left untouched in that case. This was discovered because in JSON API defualt argument value for methods wasn't onored for t_RsFlags32 arguments. --- libretroshare/src/serialiser/rstypeserializer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/serialiser/rstypeserializer.h b/libretroshare/src/serialiser/rstypeserializer.h index 4ff512c49..17b134202 100644 --- a/libretroshare/src/serialiser/rstypeserializer.h +++ b/libretroshare/src/serialiser/rstypeserializer.h @@ -658,8 +658,8 @@ struct RsTypeSerializer uint32_t f = 0; ctx.mOk &= (ctx.mOk || ctx.mFlags & RsGenericSerializer::SERIALIZATION_FLAG_YIELDING) - && from_JSON(memberName, f, ctx.mJson); - v = t_RsFlags32(f); + && from_JSON(memberName, f, ctx.mJson) + && (v = t_RsFlags32(f), true); break; } default: break;