From 81db2d7ab183e4d7eadb621ce067aca93c8a2b31 Mon Sep 17 00:00:00 2001
From: Brian Carrier <bcarrier@users.noreply.github.com>
Date: Sat, 31 Jul 2021 09:15:55 -0400
Subject: [PATCH] Added error message.

---
 tsk/fs/ntfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tsk/fs/ntfs.c b/tsk/fs/ntfs.c
index ead397aa4..3e420c7cf 100755
--- a/tsk/fs/ntfs.c
+++ b/tsk/fs/ntfs.c
@@ -1224,6 +1224,9 @@ ntfs_proc_compunit(NTFS_INFO * ntfs, NTFS_COMP_INFO * comp,
 
             // Prevent an OOB write of comp->uncomp_buf
             if ((comp->uncomp_idx >= comp->buf_size_b) || (fs->block_size > comp->buf_size_b - comp->uncomp_idx)) {
+		tsk_error_reset();
+                tsk_error_set_errno(TSK_ERR_FS_READ);
+		tsk_error_set_errstr("ntfs_proc_compunit: Buffer not big enough for uncompressed data (Index: %"PRIuSIZE ")", comp->uncomp_idx);
                 return 1;
             }
 
-- 
GitLab