added missing check after deserialisation of grouter item which caused a crash when receiving a malformed message data

This commit is contained in:
Cyril Soler 2015-12-07 10:02:04 -05:00
parent 7cd880e1e4
commit e2542a6c50

View File

@ -510,6 +510,12 @@ void p3GRouter::receiveTurtleData(RsTurtleGenericTunnelItem *gitem,const RsFileH
RsItem *itm = RsGRouterSerialiser().deserialise(item->data_bytes,&item->data_size) ; RsItem *itm = RsGRouterSerialiser().deserialise(item->data_bytes,&item->data_size) ;
if(itm == NULL)
{
std::cerr << "(EE) p3GRouter::receiveTurtleData(): cannot de-serialise data. Somthing wrong in the format. Item data (size="<< item->data_size << "): " << RsUtil::BinToHex((char*)item->data_bytes,item->data_size) << std::endl;
return ;
}
itm->PeerId(virtual_peer_id) ; itm->PeerId(virtual_peer_id) ;
// At this point we can have either a transaction chunk, or a transaction ACK. // At this point we can have either a transaction chunk, or a transaction ACK.