diff options
author | Mauro Carvalho Chehab | 2016-02-22 17:22:35 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab | 2016-02-23 11:20:47 +0100 |
commit | 2e158d45fe69b16a0d3d2777e474115fa69eb068 (patch) | |
tree | 9639e5eece7b1f80a9e2837e56ed16f185dc9d00 /drivers/media/usb/pvrusb2 | |
parent | [media] pvrusb2-io: no need to check if sp is not NULL (diff) | |
download | kernel-qcow2-linux-2e158d45fe69b16a0d3d2777e474115fa69eb068.tar.gz kernel-qcow2-linux-2e158d45fe69b16a0d3d2777e474115fa69eb068.tar.xz kernel-qcow2-linux-2e158d45fe69b16a0d3d2777e474115fa69eb068.zip |
[media] pvrusb2: don't go past buf array
That fixes the following smatch warning:
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4909 pvr2_hdw_state_log_state() error: buffer overflow 'buf' 256 <= 4294967294
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/pvrusb2')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 0533ef20decf..1a093e5953fd 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -4903,6 +4903,9 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *hdw) printk(KERN_INFO "%s %.*s\n",hdw->name,ccnt,buf); } ccnt = pvr2_hdw_report_clients(hdw, buf, sizeof(buf)); + if (ccnt >= sizeof(buf)) + ccnt = sizeof(buf); + ucnt = 0; while (ucnt < ccnt) { lcnt = 0; |