From 34f98254aa07a573dd37ca8bc5193abae5acdcf8 Mon Sep 17 00:00:00 2001
From: Brian Carrier <carrier@sleuthkit.org>
Date: Fri, 25 Mar 2011 19:56:00 +0000
Subject: [PATCH] Updated FAT sanity checks to be tougher on entries in deleted
 folders

---
 NEWS.txt             | 1 +
 tsk3/fs/fatfs_dent.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS.txt b/NEWS.txt
index 551c9a0a9..4325b7567 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -4,6 +4,7 @@ Numbers refer to SourceForge.net tracker IDs:
 ---------------- VERSION 3.2.2 --------------
 Bug Fixes
 - 3213886: ISO9660 directory hole not advancing
+- 3173095 contd: Updated checks so that tougher FAT checks are applied to deleted directories.
 
 New Features:
 - 3213888: RAW CD format
diff --git a/tsk3/fs/fatfs_dent.c b/tsk3/fs/fatfs_dent.c
index a36f80b43..3e4841042 100644
--- a/tsk3/fs/fatfs_dent.c
+++ b/tsk3/fs/fatfs_dent.c
@@ -192,7 +192,7 @@ fatfs_dent_parse_buf(FATFS_INFO * fatfs, TSK_FS_DIR * a_fs_dir, char *buf,
             fatfs_dentry *dir;
 
             /* is it a valid dentry? */
-            if (0 == fatfs_isdentry(fatfs, dep, 1)) {
+            if (0 == fatfs_isdentry(fatfs, dep, (sectalloc)?1:0)) {
                 if (tsk_verbose)
                     tsk_fprintf(stderr,
                         "fatfs_dent_parse_buf: Entry %u is invalid\n",
-- 
GitLab