OSDN Git Service

Erase struct exfat on mount to avoid uninitialized data use in case of errors.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 5 Nov 2009 20:19:03 +0000 (20:19 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 5 Nov 2009 20:19:03 +0000 (20:19 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@41 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/mount.c

index 6c8a512..f0131e1 100644 (file)
@@ -33,6 +33,7 @@ static uint64_t rootdir_size(const struct exfat* ef)
 int exfat_mount(struct exfat* ef, const char* spec)
 {
        tzset();
+       memset(ef, 0, sizeof(struct exfat));
 
        ef->sb = malloc(sizeof(struct exfat_super_block));
        if (ef->sb == NULL)