From e54bdeed8dd56d163105455a1415940a0cd7620d Mon Sep 17 00:00:00 2001 From: relan Date: Sat, 29 Dec 2012 08:01:07 +0000 Subject: [PATCH 1/1] Seek to the beginning of the device after detecting its size. dumpexfat relies on this. --- libexfat/io.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libexfat/io.c b/libexfat/io.c index 886dd23..274dbef 100644 --- a/libexfat/io.c +++ b/libexfat/io.c @@ -176,6 +176,13 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode) exfat_error("failed to get size of `%s'", spec); return NULL; } + if (exfat_seek(dev, 0, SEEK_SET) == -1) + { + close(dev->fd); + free(dev); + exfat_error("failed to seek to the beginning of `%s'", spec); + return NULL; + } } #ifdef USE_UBLIO -- 2.11.0