[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 05/49] tests: vhost-user-test: initialize 'fd' in
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 05/49] tests: vhost-user-test: initialize 'fd' in chr_read |
Date: |
Tue, 15 Jan 2019 15:04:14 -0500 |
From: Li Qiang <address@hidden>
Currently when processing VHOST_USER_SET_VRING_CALL
if 'qemu_chr_fe_get_msgfds' get no fd, the 'fd' will
be a stack uninitialized value.
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/vhost-user-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 54982f68e7..84e50d84e7 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -309,7 +309,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
CharBackend *chr = &s->chr;
VhostUserMsg msg;
uint8_t *p = (uint8_t *) &msg;
- int fd;
+ int fd = -1;
if (s->test_fail) {
qemu_chr_fe_disconnect(chr);
--
MST
- [Qemu-devel] [PULL v2 00/49] pci, pc, virtio: fixes, features, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 02/49] msix: make pba size math more uniform, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 01/49] pci/pcie: stop plug/unplug if the slot is locked, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 03/49] hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 07/49] util: check the return value of fcntl in qemu_set_{block, nonblock}, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 14/49] tests: acpi: squash sanitize_fadt_ptrs() into test_acpi_fadt_table(), Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 06/49] vhost-user: fix ioeventfd_enabled, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 05/49] tests: vhost-user-test: initialize 'fd' in chr_read,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 13/49] tests: smbios: fetch whole table in one step instead of reading it step by step, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 08/49] tests: acpi: use AcpiSdtTable::aml in consistent way, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 09/49] tests: acpi: make sure FADT is fetched only once, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 15/49] tests: acpi: use AcpiSdtTable::aml instead of AcpiSdtTable::header::signature, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 12/49] tests: acpi: reuse fetch_table() in vmgenid-test, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 11/49] tests: acpi: reuse fetch_table() for fetching FACS and DSDT, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 10/49] tests: acpi: simplify rsdt handling, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 04/49] qemu: avoid memory leak while remove disk, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 16/49] virtio-net: support RSC v4/v6 tcp traffic for Windows HCK, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 17/49] virtio-net: changed VIRTIO_NET_F_RSC_EXT to be 61, Michael S. Tsirkin, 2019/01/15