mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
b4f2912434
commit
1994dfa31a
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user