mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
media: ddbridge: fix possible buffer overflow in ddb_ports_init()
Report from smatch: drivers/media/pci/ddbridge/ddbridge-core.c:2659 ddb_ports_init() error: buffer overflow 'dev->port' 32 <= u32max Fix by making sure "p" is greater than zero before checking for "dev->port[].type == DDB_CI_EXTERNAL_XO2". Cc: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Tested-by: Richard Scobie <r.scobie@clear.net.nz> Tested-by: Jasmin Jessich <jasmin@anw.at> Tested-by: Dietmar Spingler <d_spingler@freenet.de> Tested-by: Manfred Knick <Manfred.Knick@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
f597f2a8fc
commit
8ac9fd4348
1 changed files with 1 additions and 1 deletions
|
@ -2551,7 +2551,7 @@ void ddb_ports_init(struct ddb *dev)
|
|||
port->dvb[0].adap = &dev->adap[2 * p];
|
||||
port->dvb[1].adap = &dev->adap[2 * p + 1];
|
||||
|
||||
if ((port->class == DDB_PORT_NONE) && i &&
|
||||
if ((port->class == DDB_PORT_NONE) && i && p &&
|
||||
dev->port[p - 1].type == DDB_CI_EXTERNAL_XO2) {
|
||||
port->class = DDB_PORT_CI;
|
||||
port->type = DDB_CI_EXTERNAL_XO2_B;
|
||||
|
|
Loading…
Reference in a new issue