Skip to contentSkip to conversation

V4L/DVB (3692): Keep experimental SLICED_VBI defines under an #if 0

DISCUSSION Dan Carpenter 1 participant 1 message Feb 27, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hello Hans Verkuil,

The patch 9bc7400a9d01: "V4L/DVB (3692): Keep experimental SLICED_VBI defines under an #if 0" from Mar 29, 2006, leads to the following static checker warning:

	drivers/media/i2c/tvp5150.c:719 tvp5150_get_vbi()
	error: buffer overflow regs 5 <= 14

drivers/media/i2c/tvp5150.c

   716                  }
   717                  pos = ret & 0x0f;
   718                  if (pos < 0x0f)

719 type |= regs[pos].type.vbi_type;

It used to be that regs[] had 0x10 elements (or 0xf if you don't count the empty element at the end), but we ifdef zero most of them so now we're reading beyond the end of the array.

720 }
721

regards,
dan carpenter