mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
Fix overflow in rx_icmp
This commit is contained in:
1 parent
a88a11c243
commit
9680b8ccb3
6 files changed
+34
-18
No files matched your search
@@ -453,7 +453,7 @@ static void rx_icmp(struct mip_if *ifp, struct pkt *pkt) {
|
||||
if (left > pkt->pay.len) left = pkt->pay.len; // Don't overflow TX
|
||||
memset(icmp, 0, sizeof(*icmp)); // Set csum to 0
|
||||
memcpy(icmp + 1, pkt->pay.buf, left); // Copy RX payload to TX
|
||||
icmp->csum = ipcsum(icmp, sizeof(*icmp) + pkt->pay.len);
|
||||
icmp->csum = ipcsum(icmp, sizeof(*icmp) + left);
|
||||
ifp->driver->tx(ifp->tx.buf, len + left, ifp->driver_data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user