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]
Date:	Mon, 21 Jul 2008 20:29:02 -0400
From:	roel kluin <roel.kluin@...il.com>
To:	thomas@...ischhofer.net
CC:	linux-kernel@...r.kernel.org
Subject: [PATCH 2/9] sis fb: test below 0 on unsigned type_no

u32 type_no, member of structs sis_{crt2,tv}type are unsigned,
so assignment of -1 and subsequent tests fail

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index b934384..9ec6c0e 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -266,7 +266,7 @@ sisfb_search_crt2type(const char *name)
 
 	if(name == NULL) return;
 
-	while(sis_crt2type[i].type_no != -1) {
+	while (sis_crt2type[i].type_no != ~0) {
 		if(!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
 			sisfb_crt2type = sis_crt2type[i].type_no;
 			sisfb_tvplug = sis_crt2type[i].tvplug_no;
@@ -293,7 +293,7 @@ sisfb_search_tvstd(const char *name)
 	if(name == NULL)
 		return;
 
-	while(sis_tvtype[i].type_no != -1) {
+	while (sis_tvtype[i].type_no != ~0) {
 		if(!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
 			sisfb_tvstd = sis_tvtype[i].type_no;
 			break;
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
index 3e3b7fa..5421bf2 100644
--- a/drivers/video/sis/sis_main.h
+++ b/drivers/video/sis/sis_main.h
@@ -390,7 +390,7 @@ static struct _sis_crt2type {
 	{"YPBPR1080I",	     CRT2_TV,   TV_YPBPR|TV_YPBPR1080I, FL_315},
 	{"DSTN",             CRT2_LCD,  -1,                     FL_315|FL_550_DSTN},
 	{"FSTN",             CRT2_LCD,  -1,                     FL_315|FL_550_FSTN},
-	{"\0",  	     -1, 	-1,                     0}
+	{"\0",  	     ~0, 	-1,                     0}
 };
 
 /* TV standard */
@@ -403,7 +403,7 @@ static struct _sis_tvtype {
 	{"PALM",  	TV_PAL|TV_PALM},
 	{"PALN",  	TV_PAL|TV_PALN},
 	{"NTSCJ",  	TV_NTSC|TV_NTSCJ},
-	{"\0",   	-1}
+	{"\0",   	~0}
 };
 
 static const struct _sis_vrate {
--
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