]> git.proxmox.com Git - mirror_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)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 12 Jun 2018 10:07:02 +0000 (12:07 +0200)
commitbf78fb1c1b61a819a47f7a1dbecf9934b9f32a0d
tree900b4d02e11e439785bb558ce918060e91ecc6be
parent649ae1040db656d5775f711e0dbea4c09c6c8fe9
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>
hw/usb/redirect.c