summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-03-12 08:18:38 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2015-03-12 08:18:38 +0100
commit2cd56e46956fabb35e149fa737efb302f3a63ac9 (patch)
tree041119692f97eb73d1ec92c6b4a35eb84b4ba011 /src
parentbccd8830376c48b5462f8dfb75d6a764a6d75538 (diff)
file_test_availability: discard the buffer content if less than 512 bytes has been read
Diffstat (limited to 'src')
-rw-r--r--src/hdaccess.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hdaccess.c b/src/hdaccess.c
index 878adf5..8e0634a 100644
--- a/src/hdaccess.c
+++ b/src/hdaccess.c
@@ -1514,7 +1514,7 @@ disk_t *file_test_availability(const char *device, const int verbose, int testdi
disk_car->sector_size=DEFAULT_SECTOR_SIZE;
buffer=(unsigned char*)MALLOC(DEFAULT_SECTOR_SIZE);
ewf=(const struct tdewf_file_header *)buffer;
- if(read(hd_h,buffer,DEFAULT_SECTOR_SIZE)<0)
+ if(read(hd_h,buffer,DEFAULT_SECTOR_SIZE) != DEFAULT_SECTOR_SIZE)
{
memset(buffer,0,DEFAULT_SECTOR_SIZE);
}