]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - hw/net/net_tx_pkt.c
Merge tag 'hw-misc-20240410' of https://github.com/philmd/qemu into staging
[thirdparty/qemu.git] / hw / net / net_tx_pkt.c
index 2134a18c4c90d807f6ebccc1ba608bd26109b327..b7b1de816dc52a717c6974a5654b5a5503f51184 100644 (file)
@@ -141,6 +141,10 @@ bool net_tx_pkt_update_sctp_checksum(struct NetTxPkt *pkt)
     uint32_t csum = 0;
     struct iovec *pl_start_frag = pkt->vec + NET_TX_PKT_PL_START_FRAG;
 
+    if (iov_size(pl_start_frag, pkt->payload_frags) < 8 + sizeof(csum)) {
+        return false;
+    }
+
     if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(csum)) < sizeof(csum)) {
         return false;
     }