summaryrefslogtreecommitdiffstats
path: root/exfat/libexfat
diff options
context:
space:
mode:
Diffstat (limited to 'exfat/libexfat')
-rw-r--r--exfat/libexfat/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exfat/libexfat/io.c b/exfat/libexfat/io.c
index 65df63a78..1be028cf3 100644
--- a/exfat/libexfat/io.c
+++ b/exfat/libexfat/io.c
@@ -341,7 +341,7 @@ ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
}
if (!ef->ro && !ef->noatime)
exfat_update_atime(node);
- return size - remainder;
+ return MIN(size, node->size - offset) - remainder;
}
ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node,