[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/6] usb: check USB configuration descriptor object
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 1/6] usb: check USB configuration descriptor object |
Date: |
Tue, 23 Feb 2016 11:54:53 +0100 |
From: Prasad J Pandit <address@hidden>
When processing remote NDIS control message packets, the USB Net
device emulator checks to see if the USB configuration descriptor
object is of RNDIS type(2). But it does not check if it is null,
which leads to a null dereference error. Add check to avoid it.
Reported-by: Qinghao Tang <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-network.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 985a629..5dc4538 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint32_t oid,
--
1.8.3.1
- [Qemu-devel] [PULL 0/6] usb: misc bugfixes, Gerd Hoffmann, 2016/02/23
- [Qemu-devel] [PULL 2/6] tusb6010: move from hw/timer to hw/usb, Gerd Hoffmann, 2016/02/23
- [Qemu-devel] [PULL 1/6] usb: check USB configuration descriptor object,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 4/6] usb: check RNDIS buffer offsets & length, Gerd Hoffmann, 2016/02/23
- [Qemu-devel] [PULL 5/6] usb: add pid check at the first of uhci_handle_td(), Gerd Hoffmann, 2016/02/23
- [Qemu-devel] [PULL 6/6] ohci: allocate timer only once., Gerd Hoffmann, 2016/02/23
- [Qemu-devel] [PULL 3/6] usb: check RNDIS message length, Gerd Hoffmann, 2016/02/23
- Re: [Qemu-devel] [PULL 0/6] usb: misc bugfixes, Peter Maydell, 2016/02/23