summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-02-15 16:48:58 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-02-15 16:48:58 +0100
commitde55395de3c09bf1f01eafc5c33c3513267f0a92 (patch)
tree4414f8f179ae060a45a3b77d10009758c4516c82 /src
parent416ec9551ae4071296ec1247ab5744cbf8de9129 (diff)
PhotoRec: Limit recursion when parsing TIFF images files
Diffstat (limited to 'src')
-rw-r--r--src/file_tiff_be.c2
-rw-r--r--src/file_tiff_le.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/file_tiff_be.c b/src/file_tiff_be.c
index 38b58cf..001c895 100644
--- a/src/file_tiff_be.c
+++ b/src/file_tiff_be.c
@@ -467,7 +467,7 @@ uint64_t header_check_tiff_be(file_recovery_t *fr, const uint32_t tiff_diroff, c
tiff_next_diroff=(const uint32_t *)entry;
if(be32(*tiff_next_diroff) > 0)
{
- const uint64_t new_offset=header_check_tiff_be(fr, be32(*tiff_next_diroff), depth, count+1);
+ const uint64_t new_offset=header_check_tiff_be(fr, be32(*tiff_next_diroff), depth+1, count+1);
if(new_offset != -1 && max_offset < new_offset)
max_offset=new_offset;
}
diff --git a/src/file_tiff_le.c b/src/file_tiff_le.c
index 3e6e680..b0dfda3 100644
--- a/src/file_tiff_le.c
+++ b/src/file_tiff_le.c
@@ -475,7 +475,7 @@ uint64_t header_check_tiff_le(file_recovery_t *fr, const uint32_t tiff_diroff, c
tiff_next_diroff=(const uint32_t *)entry;
if(le32(*tiff_next_diroff) > 0)
{
- const uint64_t new_offset=header_check_tiff_le(fr, le32(*tiff_next_diroff), depth, count+1);
+ const uint64_t new_offset=header_check_tiff_le(fr, le32(*tiff_next_diroff), depth+1, count+1);
if(new_offset != -1 && max_offset < new_offset)
max_offset=new_offset;
}