]> git.ipfire.org Git - thirdparty/qemu.git/commit
usb: correctly handle Zero Length Packets
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 4 Jun 2018 15:14:19 +0000 (12:14 -0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Jul 2018 16:48:21 +0000 (11:48 -0500)
commit5da7e93f51d88ab9086cd09fefc2a6cd1621b90b
treed1c542f5ab69a41755fdc43661ff629126b30259
parentc5dd07b5295402bb1ae8b1a8f1e3307b67841e05
usb: correctly handle Zero Length Packets

USB Specification Revision 2.0, §5.5.3:
  The Data stage of a control transfer from an endpoint to the host is complete when the endpoint does one of the following:
  • Has transferred exactly the amount of data specified during the Setup stage
  • Transfers a packet with a payload size less than wMaxPacketSize or transfers a zero-length packet"

hw/usb/redirect.c:802:9: warning: Declared variable-length array (VLA) has zero size
        uint8_t buf[size];
        ^~~~~~~~~~~ ~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180604151421.23385-2-f4bug@amsat.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit bf78fb1c1b61a819a47f7a1dbecf9934b9f32a0d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/usb/redirect.c