Skip to content

Commit

Permalink
Fix virtio-sock pci_vtsock_proc_tx uninitialized memory use (GHSL-202…
Browse files Browse the repository at this point in the history
…1-057)

Signed-off-by: Frederic Dalleau <frederic.dalleau@docker.com>
  • Loading branch information
fredericdalleau committed Jun 24, 2021
1 parent 41272a9 commit af5eba2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/pci_virtio_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,11 @@ static void pci_vtsock_proc_tx(struct pci_vtsock_softc *sc,
size_t pulled;

iovec_len = vq_getchain(vq, &idx, iov, VTSOCK_MAXSEGS, flags);
if (iovec_len < 0) {
fprintf(stderr, "TX: failed to get chain at idx %"PRIx16"\n", idx);
return;
}

assert(iovec_len <= VTSOCK_MAXSEGS);

DPRINTF(("TX: chain with %d buffers at idx %"PRIx16"\n",
Expand Down

0 comments on commit af5eba2

Please sign in to comment.