From a1ca403e4176531f76ac431d24079b5ebca251fa Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 30 Nov 2008 17:16:37 +0000 Subject: [PATCH] fix read potentially returning corrupt data when the hardware fails --- libntfs-3g/attrib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 87aa2e18..803d48cb 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -914,8 +914,9 @@ retry: total += br; count -= br; b = (u8*)b + br; - continue; } + if (br == to_read) + continue; /* If the syscall was interrupted, try again. */ if (br == (s64)-1 && errno == EINTR) goto retry;