libuuu: hidreport: fix read out-of-bound access during write
commitf9080cca90c76f6631581f8c53b638b2ca9d0360
authorMarco Felsch <m.felsch@pengutronix.de>
Fri, 10 Nov 2023 09:49:11 +0000 (10 10:49 +0100)
committernxpfrankli <frank.li@nxp.com>
Thu, 16 Nov 2023 21:04:42 +0000 (16 16:04 -0500)
tree749faff1629f7390b6854804ebe83520489adf34
parent26d4b25d23be55b4dda16d166954eaa1ab912dfe
libuuu: hidreport: fix read out-of-bound access during write

Since commit 3f512a617cb5 ("libuuu: hidreport: fix write size for
Windows") it may happen that the memcpy() does read outside the provided
memory. Fix this by moving the Windows HIDAPI workaround behind the
memcpy(), here no overflows can happen since the m_out_buff size is at
least m_size_out.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
libuuu/hidreport.cpp