summaryrefslogtreecommitdiffstats
path: root/src/file_asf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-09-24 08:14:40 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-09-24 08:14:40 +0200
commitcfc7256334e6d40cee5d68421333956541554efb (patch)
tree139881f6e32a167094e7fd0bb0406c25e084d3dd /src/file_asf.c
parentdb1c42bfa62eac791a02b42015c83e300dd6016d (diff)
PhotoRec: fix potential out of bound read-access affecting 32-bit version when checking asf/wmv/wma files
Bug introduced in commit #cc3b8dada5ad9f17d557bbe03a38dc23ee6e8b6c
Diffstat (limited to 'src/file_asf.c')
-rw-r--r--src/file_asf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/file_asf.c b/src/file_asf.c
index c91ad47..edc53cc 100644
--- a/src/file_asf.c
+++ b/src/file_asf.c
@@ -125,6 +125,8 @@ static int header_check_asf(const unsigned char *buffer, const unsigned int buff
else if(memcmp(stream->stream_type, wmv, sizeof(wmv))==0)
extension="wmv";
}
+ if(le64(prop->object_size) > buffer_size)
+ break;
}
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=extension;