lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4AC6FEDA.30804@freemail.hu>
Date:	Sat, 03 Oct 2009 09:35:54 +0200
From:	Németh Márton <nm127@...email.hu>
To:	Jean-Francois Moine <moinejf@...e.fr>,
	Thomas Kaiser <thomas@...ser-linux.li>
CC:	V4L Mailing List <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 3/3] pac7311: remove magic value for USB_BUF_SZ

From: Márton Németh <nm127@...email.hu>

The length check in reg_w_var() function is because the buffer contents
is copied to gspca_dev->usb_buf which has the size of USB_BUF_SZ bytes as
defined in drivers/media/video/gspca/gspca.h. Replace the number with
symbol for better readability and maintainability.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh <nm127@...email.hu>
---
diff -upr c/drivers/media/video/gspca/pac7311.c d/drivers/media/video/gspca/pac7311.c
--- c/drivers/media/video/gspca/pac7311.c	2009-10-03 08:47:30.000000000 +0200
+++ d/drivers/media/video/gspca/pac7311.c	2009-10-03 09:02:31.000000000 +0200
@@ -474,7 +474,7 @@ static void reg_w_var(struct gspca_dev *
 			reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
 			break;
 		default:
-			if (len > 64) {
+			if (len > USB_BUF_SZ) {
 				PDEBUG(D_ERR|D_STREAM,
 					"Incorrect variable sequence");
 				return;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ