]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] c8sectpfe: don't go past channel_data array
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 19:13:54 +0000 (16:13 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 19:16:55 +0000 (16:16 -0300)
As reported by smatch:
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:365 find_channel() error: buffer overflow 'fei->channel_data' 8 <= 63

It seems that a cut-and-paste type of error occurred here:
the channel_data array size is C8SECTPFE_MAX_TSIN_CHAN, and not
C8SECTPFE_MAXCHANNEL.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c

index 3a9109356e67dcc8a7ecad71fdad20f836cfe78a..955d8daf055f866bb0edb3a57ad33c2c0a4722b1 100644 (file)
@@ -361,7 +361,7 @@ static struct channel_info *find_channel(struct c8sectpfei *fei, int tsin_num)
 {
        int i;
 
-       for (i = 0; i < C8SECTPFE_MAXCHANNEL; i++) {
+       for (i = 0; i < C8SECTPFE_MAX_TSIN_CHAN; i++) {
                if (!fei->channel_data[i])
                        continue;