check RouterInfo store msg buffer size before extracting size

This commit is contained in:
orignal committed 2026-11-13 09:04:17 -05:00
1 parent 9a284ac7e5
commit 0c8c0e85a7
1 file changed
+5
+5
View File
@@ -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)