Browse Source

Merge remote-tracking branch 'purple/openssl' into i2cp-session-reconfig

pull/1130/head
Jeff Becker 7 years ago
parent
commit
68b1afa2df
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
  1. 14
      libi2pd/Garlic.cpp

14
libi2pd/Garlic.cpp

@ -548,8 +548,8 @@ namespace garlic
case eGarlicDeliveryTypeDestination: case eGarlicDeliveryTypeDestination:
LogPrint (eLogDebug, "Garlic: type destination"); LogPrint (eLogDebug, "Garlic: type destination");
buf += 32; // destination. check it later or for multiple destinations buf += 32; // destination. check it later or for multiple destinations
offset = buf1 - buf; offset = buf - buf1;
if (offset > (int)len || offset <= 0) if (offset > (int)len)
{ {
LogPrint (eLogError, "Garlic: message is too short"); LogPrint (eLogError, "Garlic: message is too short");
break; break;
@ -562,8 +562,8 @@ namespace garlic
// gwHash and gwTunnel sequence is reverted // gwHash and gwTunnel sequence is reverted
uint8_t * gwHash = buf; uint8_t * gwHash = buf;
buf += 32; buf += 32;
offset = buf1 - buf; offset = buf - buf1;
if (offset + 4 > (int)len || offset <= 0) if (offset + 4 > (int)len)
{ {
LogPrint (eLogError, "Garlic: message is too short"); LogPrint (eLogError, "Garlic: message is too short");
break; break;
@ -591,7 +591,7 @@ namespace garlic
{ {
uint8_t * ident = buf; uint8_t * ident = buf;
buf += 32; buf += 32;
offset = buf1 - buf; offset = buf - buf1;
if (!from) // received directly if (!from) // received directly
{ {
if (offset > (int)len || offset <= 0) if (offset > (int)len || offset <= 0)
@ -618,8 +618,8 @@ namespace garlic
buf += 4; // CloveID buf += 4; // CloveID
buf += 8; // Date buf += 8; // Date
buf += 3; // Certificate buf += 3; // Certificate
offset = buf1 - buf; offset = buf - buf1;
if (offset > (int)len || offset <= 0) if (offset > (int)len)
{ {
LogPrint (eLogError, "Garlic: clove is too long"); LogPrint (eLogError, "Garlic: clove is too long");
break; break;

Loading…
Cancel
Save