summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-07-14 16:33:39 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-07-14 16:33:39 +0200
commit3b482239db60d25ecdf72ba33aff70ba8cac4da1 (patch)
tree4368db885d7e511baed848bafac1d9da9c37f873
parent0f97d72be8db4447e4c99e851cce491d9cfa1227 (diff)
PhotoRec: fix file_rsearch() function to avoid a false positive.
Thanks to Adel KHALDI from Blue Frost Security GmbH for asking how this function was working.
-rw-r--r--configure.ac2
-rw-r--r--src/filegen.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 8a120ab..5ab5612 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_INIT([testdisk],[7.1-WIP],[grenier@cgsecurity.org])
AC_LANG(C)
sinclude(acx_pthread.m4)
sinclude(mkdir.m4)
-TESTDISKDATE="May 2017"
+TESTDISKDATE="July 2017"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
AC_CONFIG_AUX_DIR(config)
diff --git a/src/filegen.c b/src/filegen.c
index 814d1c7..919b918 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -220,7 +220,7 @@ uint64_t file_rsearch(FILE *handle, uint64_t offset, const void*footer, const un
return offset + i;
}
}
- memcpy(buffer+read_size,buffer,footer_length-1);
+ memcpy(buffer+4096,buffer,footer_length-1);
} while(offset>0);
free(buffer);
return 0;