mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-26 10:55:24 +02:00
Merge dacd97de30
into ca49944c85
This commit is contained in:
commit
c354230ae7
1 changed files with 5 additions and 5 deletions
|
@ -538,7 +538,7 @@ namespace garlic
|
|||
{
|
||||
case eGarlicDeliveryTypeLocal:
|
||||
LogPrint (eLogDebug, "Garlic: type local");
|
||||
if (offset > (int)len)
|
||||
if (offset > (int)len || offset <= 0)
|
||||
{
|
||||
LogPrint (eLogError, "Garlic: message is too short");
|
||||
break;
|
||||
|
@ -549,7 +549,7 @@ namespace garlic
|
|||
LogPrint (eLogDebug, "Garlic: type destination");
|
||||
buf += 32; // destination. check it later or for multiple destinations
|
||||
offset = buf1 - buf;
|
||||
if (offset > (int)len)
|
||||
if (offset > (int)len || offset <= 0)
|
||||
{
|
||||
LogPrint (eLogError, "Garlic: message is too short");
|
||||
break;
|
||||
|
@ -563,7 +563,7 @@ namespace garlic
|
|||
uint8_t * gwHash = buf;
|
||||
buf += 32;
|
||||
offset = buf1 - buf;
|
||||
if (offset + 4 > (int)len)
|
||||
if (offset + 4 > (int)len || offset < 4)
|
||||
{
|
||||
LogPrint (eLogError, "Garlic: message is too short");
|
||||
break;
|
||||
|
@ -594,7 +594,7 @@ namespace garlic
|
|||
offset = buf1 - buf;
|
||||
if (!from) // received directly
|
||||
{
|
||||
if (offset > (int)len)
|
||||
if (offset > (int)len || offset <= 0)
|
||||
{
|
||||
LogPrint (eLogError, "Garlic: message is too short");
|
||||
break;
|
||||
|
@ -609,7 +609,7 @@ namespace garlic
|
|||
default:
|
||||
LogPrint (eLogWarning, "Garlic: unknown delivery type ", (int)deliveryType);
|
||||
}
|
||||
if (offset > (int)len)
|
||||
if (offset > (int)len || offset <= 0)
|
||||
{
|
||||
LogPrint (eLogError, "Garlic: message is too short");
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue