diff --git a/libi2pd/NetDb.cpp b/libi2pd/NetDb.cpp index 93043557..e75c0b18 100644 --- a/libi2pd/NetDb.cpp +++ b/libi2pd/NetDb.cpp @@ -903,6 +903,11 @@ namespace data { if (CheckLogLevel (eLogDebug)) LogPrint (eLogDebug, "NetDb: Store request: RouterInfo ", ident.ToBase64()); + if (offset + 2 > len) + { + LogPrint (eLogError, "NetDb: RouterInfo store msg is too short ", len); + return; + } size_t size = bufbe16toh (buf + offset); offset += 2; if (size > MAX_RI_BUFFER_SIZE || size > len - offset)