summaryrefslogtreecommitdiffstats
path: root/src/exfat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-04-25 09:51:34 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-04-25 09:51:34 +0200
commit0958283b260b5251061329e6b57414b89e95cd15 (patch)
treebac34b39cfc3080667766ed90dcdb9f7090f1b9d /src/exfat_dir.c
parent89c0713c791b503eda39283eb838b2646f8570c7 (diff)
Fix read error detection in exfat_copy()
Diffstat (limited to 'src/exfat_dir.c')
-rw-r--r--src/exfat_dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/exfat_dir.c b/src/exfat_dir.c
index b9e7002..d66bd05 100644
--- a/src/exfat_dir.c
+++ b/src/exfat_dir.c
@@ -84,7 +84,7 @@ static inline void exfat16_towchar(wchar_t *dst, const uint8_t *src, size_t len)
#define ATTR_ARCH 32 /* archived */
#define EXFAT_MKMODE(a,m) ((m & (a & ATTR_RO ? LINUX_S_IRUGO|LINUX_S_IXUGO : LINUX_S_IRWXUGO)) | (a & ATTR_DIR ? LINUX_S_IFDIR : LINUX_S_IFREG))
-file_data_t *dir_exfat_aux(const unsigned char*buffer, const unsigned int size, const unsigned int cluster_size, const unsigned int param)
+static file_data_t *dir_exfat_aux(const unsigned char*buffer, const unsigned int size, const unsigned int param)
{
/*
* 0x83 Volume label
@@ -270,7 +270,7 @@ static file_data_t *exfat_dir(disk_t *disk, const partition_t *partition, dir_da
}
}
if(nbr_cluster>0)
- dir_list=dir_exfat_aux(buffer_dir, nbr_cluster<<cluster_shift, 1<<cluster_shift, dir_data->param);
+ dir_list=dir_exfat_aux(buffer_dir, nbr_cluster<<cluster_shift, dir_data->param);
free(buffer_dir);
return dir_list;
}
@@ -382,7 +382,7 @@ static int exfat_copy(disk_t *disk, const partition_t *partition, dir_data_t *di
unsigned int toread = 1 << cluster_shift;
if (toread > file_size)
toread = file_size;
- if((unsigned)exfat_read_cluster(disk, partition, exfat_header, buffer_file, cluster) != toread)
+ if((unsigned)exfat_read_cluster(disk, partition, exfat_header, buffer_file, cluster) < toread)
{
log_error("exfat_copy: Can't read cluster %u.\n", cluster);
}