]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Avoid passing a possible garbage pointer to free().
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 29 Nov 2022 01:10:30 +0000 (17:10 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 29 Nov 2022 01:10:30 +0000 (17:10 -0800)
commitbc928800723b65daa9b005bec4ffd8ad8c781a09
tree562f9eb5402f9ea63f3c5c3a299fe06a0b77050d
parent32b21dd2719f87811b66deeeb513acf7067f8fac
bhyve: Avoid passing a possible garbage pointer to free().

All of the error paths in pci_vtcon_sock_add free the sock pointer.
However, sock is not initialized until part way through the function.
An early error would pass stack garbage to free().

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37491
usr.sbin/bhyve/pci_virtio_console.c