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>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 Jan 2009 00:35:47 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	mchehab@...hat.com
CC:	video4linux-list@...hat.com, lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] DVB: negative internal->sub_range won't get noticed

internal->sub_range is unsigned, a negative won't get noticed.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c
index 83dc7e1..2ea32da 100644
--- a/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
@@ -464,13 +464,14 @@ static void next_sub_range(struct stb0899_state *state)
 
 	if (internal->sub_dir > 0) {
 		old_sub_range = internal->sub_range;
-		internal->sub_range = MIN((internal->srch_range / 2) -
+		if (internal->tuner_offst + internal->sub_range / 2 >=
+				internal->srch_range / 2)
+			internal->sub_range = 0;
+		else
+			internal->sub_range = MIN((internal->srch_range / 2) -
 					  (internal->tuner_offst + internal->sub_range / 2),
 					   internal->sub_range);
 
-		if (internal->sub_range < 0)
-			internal->sub_range = 0;
-
 		internal->tuner_offst += (old_sub_range + internal->sub_range) / 2;
 	}
 

--
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