summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-07-05 15:22:45 -0400
committerAndy Walls <awalls@radix.net>2009-07-05 15:22:45 -0400
commit6c5e5c49e6eac8f1e8e954d614a31676a7da755d (patch)
tree6fec8ac16b6fe597edd096ca683b52f3d884df04
parente1afff6e5f2d6b35928ab6651ac5705659713ca0 (diff)
downloadmediapointer-dvb-s2-6c5e5c49e6eac8f1e8e954d614a31676a7da755d.tar.gz
mediapointer-dvb-s2-6c5e5c49e6eac8f1e8e954d614a31676a7da755d.tar.bz2
get_dvb_firmware: Correct errors in MPC718 firmware extraction logic
From: Andy Walls <awalls@radix.net> 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 <awalls@radix.net>
-rwxr-xr-xlinux/Documentation/dvb/get_dvb_firmware3
1 files changed, 2 insertions, 1 deletions
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 (<IN>) {
$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;