rsrv: catch overflow of extended message size

Treat as corruption, and ignore/close
This commit is contained in:
Michael Davidsaver authored and Dirk Zimoch committed 2026-10-14 15:12:07 +02:00
1 parent 3cd526411f
commit 2ae6e4f85a
1 file changed
+8
@@ -2473,6 +2473,14 @@ int camessage ( struct client *client )
}
msg.m_postsize = ntohl ( pLW[0] );
msg.m_count = ntohl ( pLW[1] );
if (msg.m_postsize >= 0xffffffff - (sizeof(*mp) + 2 * sizeof ( *pLW ))) {
if(CASDEBUG>0) {
errlogPrintf("Client ext msg size too large 0x%08x\n",
(unsigned)msg.m_postsize);
}
status = RSRV_ERROR;
break;
}
msgsize = msg.m_postsize + sizeof(*mp) + 2 * sizeof ( *pLW );
pBody = pLW + 2;
}