[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>
This commit is contained in:
Mauro Carvalho Chehab 2016-02-22 13:22:35 -03:00
parent 19409c8969
commit 2e158d45fe
1 changed files with 3 additions and 0 deletions

View File

@ -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); printk(KERN_INFO "%s %.*s\n",hdw->name,ccnt,buf);
} }
ccnt = pvr2_hdw_report_clients(hdw, buf, sizeof(buf)); ccnt = pvr2_hdw_report_clients(hdw, buf, sizeof(buf));
if (ccnt >= sizeof(buf))
ccnt = sizeof(buf);
ucnt = 0; ucnt = 0;
while (ucnt < ccnt) { while (ucnt < ccnt) {
lcnt = 0; lcnt = 0;