mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 23:19:50 +00:00
wacom-usb: Fix a potentially unsafe memcpy()
Spotted by Coverity.
This commit is contained in:
parent
128a3afaa9
commit
39e006e563
@ -82,7 +82,15 @@ fu_wac_module_touch_write_firmware(FuDevice *device,
|
||||
buf[1] = fu_chunk_get_idx(chk) + 1;
|
||||
fu_common_write_uint32(&buf[2], fu_chunk_get_address(chk), G_LITTLE_ENDIAN);
|
||||
buf[6] = 0x10; /* no idea! */
|
||||
memcpy(&buf[7], fu_chunk_get_data(chk), fu_chunk_get_data_sz(chk));
|
||||
if (!fu_memcpy_safe(buf,
|
||||
sizeof(buf),
|
||||
0x07, /* dst */
|
||||
fu_chunk_get_data(chk),
|
||||
fu_chunk_get_data_sz(chk),
|
||||
0x0, /* src */
|
||||
fu_chunk_get_data_sz(chk),
|
||||
error))
|
||||
return FALSE;
|
||||
blob_chunk = g_bytes_new(buf, sizeof(buf));
|
||||
if (!fu_wac_module_set_feature(self,
|
||||
FU_WAC_MODULE_COMMAND_DATA,
|
||||
|
Loading…
Reference in New Issue
Block a user