]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 232: don't overwrite ECM frame data with corrupt frames
authorLee Howard <faxguy@howardsilvan.com>
Mon, 11 Jul 2005 15:14:05 +0000 (15:14 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Mon, 11 Jul 2005 15:14:05 +0000 (15:14 +0000)
CHANGES
faxd/Class1Recv.c++

diff --git a/CHANGES b/CHANGES
index e5399a7c75254157ec15a7bfe07fbb1668e56817..9cbd1ca987765828102582bcc3efd7b70f5c0fa9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changelog for HylaFAX 4.2.2
 
+* fix ECM frame data from being overwritten by corrupt frames later
+  (11 Jul 2005)
 * fix a faxq crash involving job alteration (4 Jul 2005)
 * fix error of a pipe file descriptors not being closed (15 Jun 2005)
 * fix error in not employing Class1SwitchingCmd before sending
index c1825ca59f49c1cbf85a973e6ae3074aa5efcd49..2923118b5d2763c1881f695085da8720f11887b1 100644 (file)
@@ -1220,12 +1220,12 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, fxStr& emsg)
                            rcpcnt = 0;                 // reset RCP counter
                            fnum = frameRev[frame[3]];  // T.4 A.3.6.1 says LSB2MSB
                            protoTrace("RECV received frame number %u", fnum);
-                           // store received frame in block at position fnum (A+C+FCF+Frame No.=4 bytes)
-                           for (u_int i = 0; i < frameSize; i++) {
-                               if (frame.getLength() - 6 > i)  // (A+C+FCF+Frame No.+FCS=6 bytes)
-                                   block[fnum*frameSize+i] = frameRev[frame[i+4]];     // LSB2MSB
-                           }
                            if (frame.checkCRC()) {
+                               // store received frame in block at position fnum (A+C+FCF+Frame No.=4 bytes)
+                               for (u_int i = 0; i < frameSize; i++) {
+                                   if (frame.getLength() - 6 > i)      // (A+C+FCF+Frame No.+FCS=6 bytes)
+                                       block[fnum*frameSize+i] = frameRev[frame[i+4]]; // LSB2MSB
+                               }
                                if (fcount < (fnum + 1)) fcount = fnum + 1;
                                // valid frame, set the corresponding bit in ppr to 0
                                u_int pprpos, pprval;