summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-04-26 18:44:05 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-04-26 18:44:05 +0200
commitfd1fe33008bacf9f19bb9e83f6467d61f27b54dd (patch)
treefaac69c277805361dbb6b5d579a9ad3395e616be /src
parenta71b112d58f8a8398af7678653e82490791564b3 (diff)
header_ignored_adv(): Always restore location in openned file
Diffstat (limited to 'src')
-rw-r--r--src/filegen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/filegen.c b/src/filegen.c
index f48f21d..d6eb2dc 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -613,7 +613,9 @@ int header_ignored_adv(const file_recovery_t *file_recovery, const file_recovery
if(file_recovery->handle==NULL)
{
if(file_recovery_new->location.start==0 || offset_skipped_header==0)
+ {
offset_skipped_header=file_recovery_new->location.start;
+ }
return 0;
}
@@ -626,15 +628,17 @@ int header_ignored_adv(const file_recovery_t *file_recovery, const file_recovery
#endif
assert(offset >= 0);
file_recovery->file_check(&fr_test);
- if(fr_test.file_size>0)
- return 1;
if(my_fseek(file_recovery->handle, offset, SEEK_SET) < 0)
{
log_error("BUG in header_ignored_adv: my_fseek() failed\n");
return 1;
}
+ if(fr_test.file_size>0)
+ return 1;
if(file_recovery_new->location.start==0 || offset_skipped_header==0)
+ {
offset_skipped_header=file_recovery_new->location.start;
+ }
return 0;
}