We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f38219 commit a95ef01Copy full SHA for a95ef01
drivers/input/misc/ims-pcu.c
@@ -844,6 +844,12 @@ static int ims_pcu_flash_firmware(struct ims_pcu *pcu,
844
addr = be32_to_cpu(rec->addr) / 2;
845
len = be16_to_cpu(rec->len);
846
847
+ if (len > sizeof(pcu->cmd_buf) - 1 - sizeof(*fragment)) {
848
+ dev_err(pcu->dev,
849
+ "Invalid record length in firmware: %d\n", len);
850
+ return -EINVAL;
851
+ }
852
+
853
fragment = (void *)&pcu->cmd_buf[1];
854
put_unaligned_le32(addr, &fragment->addr);
855
fragment->len = len;
0 commit comments