From e913f3689a62ba5992238db9b7cab6fd1a67e49d Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 4 May 2017 21:40:32 +0200 Subject: [PATCH] fixed crash when trying to deserialize an empty buffer in rsrecogn --- libretroshare/src/util/rsrecogn.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretroshare/src/util/rsrecogn.cc b/libretroshare/src/util/rsrecogn.cc index f42a4dd6f..8580c7780 100644 --- a/libretroshare/src/util/rsrecogn.cc +++ b/libretroshare/src/util/rsrecogn.cc @@ -552,6 +552,9 @@ RsGxsRecognTagItem *RsRecogn::extractTag(const std::string &encoded) std::vector buffer = Radix64::decode(encoded); pktsize = buffer.size(); + if(buffer.empty()) + return NULL ; + RsGxsRecognSerialiser serialiser; RsItem *item = serialiser.deserialise(buffer.data(), &pktsize);