Fixed possible crash in the handle methods of RsGxsNetService when the dynamic cast of a received item fails.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7922 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-02-07 10:09:48 +00:00
parent 030c69d95b
commit 83f2ee4c95

View File

@ -2606,6 +2606,8 @@ bool RsGxsNetService::locked_CanReceiveUpdate(const RsNxsSyncGrp *item)
void RsGxsNetService::handleRecvSyncGroup(RsNxsSyncGrp* item) void RsGxsNetService::handleRecvSyncGroup(RsNxsSyncGrp* item)
{ {
if (!item)
return;
RS_STACK_MUTEX(mNxsMutex) ; RS_STACK_MUTEX(mNxsMutex) ;
@ -2956,6 +2958,9 @@ bool RsGxsNetService::locked_CanReceiveUpdate(const RsNxsSyncMsg *item)
} }
void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item) void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
{ {
if (!item)
return;
RS_STACK_MUTEX(mNxsMutex) ; RS_STACK_MUTEX(mNxsMutex) ;
// We do that early, so as to get info about who sends data about which group, // We do that early, so as to get info about who sends data about which group,
@ -3366,6 +3371,10 @@ void RsGxsNetService::handleRecvPublishKeys(RsNxsGroupPublishKeyItem *item)
#ifdef NXS_NET_DEBUG #ifdef NXS_NET_DEBUG
std::cerr << "RsGxsNetService::sharePublishKeys() " << std::endl; std::cerr << "RsGxsNetService::sharePublishKeys() " << std::endl;
#endif #endif
if (!item)
return;
RS_STACK_MUTEX(mNxsMutex) ; RS_STACK_MUTEX(mNxsMutex) ;
#ifdef NXS_NET_DEBUG #ifdef NXS_NET_DEBUG