From 4d8291bb4c3ee0516882de4c6277c53548160b23 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 26 Jul 2014 16:20:44 +0200 Subject: [PATCH] PhotoRec: stricter checl for .lxo files --- src/file_lxo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/file_lxo.c b/src/file_lxo.c index 32d21419..532414c0 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);