Avoid crash when subscribeToChannel is fed with invaled channel id

Fix a couple compiler warning too
This commit is contained in:
Gioacchino Mazzurco 2019-09-27 16:21:08 +02:00
parent ce3e2a2c9d
commit 3b8f6997bb
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
5 changed files with 42 additions and 37 deletions

View file

@ -1493,6 +1493,11 @@ int RsDataService::retrieveGxsGrpMetaData(RsGxsGrpMetaTemporaryMap& grp)
std::cerr << "RsDataService::retrieveGxsGrpMetaData() " << mDbName << ", Requests: " << requestedGroups << ", Results: " << resultCount << ", Time: " << timer.duration() << std::endl;
#endif
/* Remove not found entries as stated in the documentation */
for(auto i = grp.begin(); i != grp.end();)
if(!i->second) i = grp.erase(i);
else ++i;
return 1;
}

View file

@ -1009,18 +1009,14 @@ bool RsGxsDataAccess::getGroupSummary(GroupMetaReq* req)
}
bool RsGxsDataAccess::getGroupList(GroupIdReq* req)
{
getGroupList(req->mGroupIds, req->Options, req->mGroupIdResult);
return true;
}
{ return getGroupList(req->mGroupIds, req->Options, req->mGroupIdResult); }
bool RsGxsDataAccess::getGroupList(const std::list<RsGxsGroupId>& grpIdsIn, const RsTokReqOptions& opts, std::list<RsGxsGroupId>& grpIdsOut)
{
RsGxsGrpMetaTemporaryMap grpMeta;
for(auto lit = grpIdsIn.begin(); lit != grpIdsIn.end(); ++lit)
grpMeta[*lit] = NULL;
grpMeta[*lit] = nullptr;
mDataStore->retrieveGxsGrpMetaData(grpMeta);