fixed looping in pqistore when a crazily long packet is found. That is the result of an unknown bug, but at least we should handle it correctly.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6568 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-08-08 18:59:35 +00:00
parent b4f2912434
commit 1994dfa31a

View File

@ -306,7 +306,11 @@ int pqistore::readPkt(RsItem **item_out)
int extralen = getRsItemSize(block) - blen;
if(extralen+blen > maxlen)
{
free(block) ;
std::cerr << "***** ERROR: trying to read a packet of length " << extralen+blen << ", while the maximum length is " << maxlen << std::endl ;
return 0 ;
}
if (extralen > 0)
{
@ -496,7 +500,11 @@ int pqiSSLstore::readPkt(RsItem **item_out)
int extralen = getRsItemSize(block) - blen;
if(extralen+blen > maxlen)
{
free(block) ;
std::cerr << "***** ERROR: trying to read a packet of length " << extralen+blen << ", while the maximum length is " << maxlen << std::endl ;
return 0 ;
}
if (extralen > 0)
{