[linux-dvb] [PATCH] Fix buffer overflow when more than 4 bt878 devices are installed in the same computer

Sigmund Augdal Helberg sigmund at snap.tv
Thu Jan 12 16:21:04 CET 2006


Signed-off-by: Sigmund Augdal Helberg <sigmund at snap.tv>

diff -Nupar cgi-bin-hgwebdir-cgi-v4l-algo-test-675755d11eb2/linux/drivers/media/dvb/bt8xx/bt878.c v4l-dvb-sigmund/linux/drivers/media/dvb/bt8xx/bt878.c
--- cgi-bin-hgwebdir-cgi-v4l-algo-test-675755d11eb2/linux/drivers/media/dvb/bt8xx/bt878.c	2006-01-12 14:55:53.000000000 +0100
+++ v4l-dvb-sigmund/linux/drivers/media/dvb/bt8xx/bt878.c	2006-01-12 16:28:59.000000000 +0100
@@ -400,6 +400,11 @@ static int __devinit bt878_probe(struct 
 	if (pci_enable_device(dev))
 		return -EIO;
 
+	if (bt878_num >= BT878_MAX) {
+		printk(KERN_ERR "bt878: Too many devices inserted\n");
+		result = -ENOMEM;
+		goto fail0;
+	}
 	bt = &bt878[bt878_num];
 	bt->dev = dev;
 	bt->nr = bt878_num;





More information about the linux-dvb mailing list