[PATCH] rx: Fix file corruption with duplicate blocks

Dan Fandrich dan at coneharvesters.com
Wed Nov 2 23:24:09 UTC 2011


Rather than dropping the dupe, rx would append it to the file.

Signed-off-by: Dan 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 e122577..972f7ff 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -172,6 +172,7 @@ static int receive(/*int read_fd, */int file_fd)
 			/* a repeat of the last block is ok, just ignore it. */
 			/* this also ignores the initial block 0 which is */
 			/* meta data. */
+			blockLength = 0;
 			goto next;
 		}
 		if (blockNo != (wantBlockNo & 0xff)) {
-- 
1.5.3.2



More information about the busybox mailing list