From 6c5e5c49e6eac8f1e8e954d614a31676a7da755d Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sun, 5 Jul 2009 15:22:45 -0400 Subject: get_dvb_firmware: Correct errors in MPC718 firmware extraction logic From: Andy Walls The extraction routine for the MPC718 "firmware" had 2 bugs in it, where one bug masked the effect of the other. The loop iteration should have set $prevlen = $currlen at the end of the loop, and the if() check should have used && instead of || for deciding if the firmware length is reasonable. Priority: normal Signed-off-by: Andy Walls --- linux/Documentation/dvb/get_dvb_firmware | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux/Documentation') diff --git a/linux/Documentation/dvb/get_dvb_firmware b/linux/Documentation/dvb/get_dvb_firmware index 64174d625..3d1b0ab70 100755 --- a/linux/Documentation/dvb/get_dvb_firmware +++ b/linux/Documentation/dvb/get_dvb_firmware @@ -413,13 +413,14 @@ sub mpc718 { while () { $currlen = length($_); - if ($prevlen == $currlen || $currlen <= 64) { + if ($prevlen == $currlen && $currlen <= 64) { chop; chop; # Get rid of "TUNER GO" s/^\0\0//; # get rid of leading 00 00 if it's there printf OUT "$_"; $found = 1; last; } + $prevlen = $currlen; } } close OUT; -- cgit v1.2.3