summaryrefslogtreecommitdiffstats
path: root/src/ewf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-10-14 22:22:56 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-10-14 22:22:56 +0200
commitcd7d33bf0481069ca138562f18a23706a45002ea (patch)
tree1ea983493f02d3d19f42370bd8041be247838cf8 /src/ewf.c
parent958f0a086e8af45e8ae7483f380eee37cce0306d (diff)
FIX: call libewf_handle_initialize() before each libewf_handle_open()
Diffstat (limited to 'src/ewf.c')
-rw-r--r--src/ewf.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/ewf.c b/src/ewf.c
index e23ee95..591a253 100644
--- a/src/ewf.c
+++ b/src/ewf.c
@@ -134,19 +134,6 @@ disk_t *fewf_init(const char *device, const int mode)
free(data);
return NULL;
}
- if( libewf_handle_initialize(
- &( data->handle ),
- NULL ) != 1 )
- {
- log_error("libewf_handle_initialize failed\n");
-
- libewf_glob_free(
- filenames,
- num_files,
- NULL );
- free(data);
- return NULL;
- }
#elif defined( HAVE_GLOB_H )
{
globbuf.gl_offs = 0;
@@ -176,6 +163,19 @@ disk_t *fewf_init(const char *device, const int mode)
if((mode&TESTDISK_O_RDWR)==TESTDISK_O_RDWR)
{
#if defined( HAVE_LIBEWF_V2_API )
+ if( libewf_handle_initialize(
+ &( data->handle ),
+ NULL ) != 1 )
+ {
+ log_error("libewf_handle_initialize failed\n");
+
+ libewf_glob_free(
+ filenames,
+ num_files,
+ NULL );
+ free(data);
+ return NULL;
+ }
if( libewf_handle_open(
data->handle,
filenames,
@@ -197,6 +197,19 @@ disk_t *fewf_init(const char *device, const int mode)
{
data->mode&=~TESTDISK_O_RDWR;
#if defined( HAVE_LIBEWF_V2_API )
+ if( libewf_handle_initialize(
+ &( data->handle ),
+ NULL ) != 1 )
+ {
+ log_error("libewf_handle_initialize failed\n");
+
+ libewf_glob_free(
+ filenames,
+ num_files,
+ NULL );
+ free(data);
+ return NULL;
+ }
if( libewf_handle_open(
data->handle,
filenames,