mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added a security check to avoid core dump when a bad p3discReply packet is received
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2762 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
890622f413
commit
c4de9f0219
@ -416,7 +416,9 @@ RsDiscReply *RsDiscSerialiser::deserialiseReply(void *data, uint32_t *pktsize)
|
|||||||
memcpy(peerNetdata, (void *) (((char *) data) + offset), peerNetSize);
|
memcpy(peerNetdata, (void *) (((char *) data) + offset), peerNetSize);
|
||||||
RsPeerNetItem *rsPeerNetItem = (RsPeerNetItem*)rss->deserialise(peerNetdata, &peerNetSize);
|
RsPeerNetItem *rsPeerNetItem = (RsPeerNetItem*)rss->deserialise(peerNetdata, &peerNetSize);
|
||||||
offset += peerNetSize;
|
offset += peerNetSize;
|
||||||
item->rsPeerList.push_back(*rsPeerNetItem);
|
|
||||||
|
if(rsPeerNetItem != NULL)
|
||||||
|
item->rsPeerList.push_back(*rsPeerNetItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset != rssize) {
|
if (offset != rssize) {
|
||||||
|
Loading…
Reference in New Issue
Block a user