From 65a1ee956f0721ad3cebf79c0a6b3266a0676524 Mon Sep 17 00:00:00 2001 From: Daniel Fandrich Date: Wed, 23 Nov 2011 12:07:31 +0100 Subject: [PATCH] rx: fix file corruption on block checksum failure Rather than dropping the bad block, rx was appending it to the file. Signed-off-by: Daniel Fandrich Signed-off-by: Denys Vlasenko --- miscutils/rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/miscutils/rx.c b/miscutils/rx.c index c48a61fd0..af597320c 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 */ -- 2.25.1