summaryrefslogtreecommitdiffstats
path: root/src/file_lxo.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-26 16:20:44 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-26 16:20:44 +0200
commit4d8291bb4c3ee0516882de4c6277c53548160b23 (patch)
tree85d4588e6969c44df795c77e83f3c44adbe5f7dd /src/file_lxo.c
parent8f1719f73a88bcca56986429ec2f2033b271f173 (diff)
PhotoRec: stricter checl for .lxo files
Diffstat (limited to 'src/file_lxo.c')
-rw-r--r--src/file_lxo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/file_lxo.c b/src/file_lxo.c
index 32d2141..532414c 100644
--- a/src/file_lxo.c
+++ b/src/file_lxo.c
@@ -53,6 +53,8 @@ struct lxo_header
static int header_check_lxo(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
const struct lxo_header *header=(const struct lxo_header *)buffer;
+ if(be32(header->size) +8 < sizeof(struct lxo_header))
+ return 0;
if(buffer[8]=='L' && buffer[9]=='X' && buffer[10]=='O')
{
reset_file_recovery(file_recovery_new);