rpc : add bounds check in rdma_recv (#30399)

This commit is contained in:
Katara authored and GitHub committed 2026-10-24 18:34:46 +03:00
1 parent e168e041ec
commit 9a0fde9967
1 file changed
+5
+5
View File
@@ -517,6 +517,11 @@ bool socket_t::impl::rdma_recv(void * data, size_t size) {
int slot = (int)wc.wr_id;
size_t got = wc.byte_len;
if (got > rem) {
LOG_ERROR("RDMA recv overrun: got=%zu rem=%zu\n", got, rem);
c->post_rx(slot);
return false;
}
memcpy(dst, c->rx_slot(slot), got);
if (!c->post_rx(slot)) return false;