[PATCH] rx: Fix file corruption on block checksum failure

Daniel Fandrich dan at coneharvesters.com
Fri Nov 4 20:58:42 UTC 2011


Rather than dropping the bad block, rx was appending it
to the file.

Signed-off-by: Daniel Fandrich <dan at coneharvesters.com>
---
 miscutils/rx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/miscutils/rx.c b/miscutils/rx.c
index c48a61f..af59732 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -207,6 +207,7 @@ static int receive(/*int read_fd, */int file_fd)
 		continue;
  error:
  timeout:
+		blockLength = 0;
 		errors++;
 		if (errors == MAXERRORS) {
 			/* Abort */
-- 
1.7.0.4



More information about the busybox mailing list