From 1bc996f52f1291896177daee15ca9ee5fa2c928d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 14 Aug 2020 11:36:57 +0200 Subject: [PATCH] Avoided information leak when processing garbled compressed data When a compressed file has been deteriorated through hardware error or accidental overwriting, some unrelated data could be leaked. Make sure to zero fill the buffer when this happens. --- libntfs-3g/compress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libntfs-3g/compress.c b/libntfs-3g/compress.c index 2c0c260a..fb69a0e6 100644 --- a/libntfs-3g/compress.c +++ b/libntfs-3g/compress.c @@ -491,6 +491,8 @@ do_next_sb: * first two checks do not detect it. */ if (cb == cb_end || !le16_to_cpup((le16*)cb) || dest == dest_end) { + if (dest_end > dest) + memset(dest, 0, dest_end - dest); ntfs_log_debug("Completed. Returning success (0).\n"); return 0; } -- 2.11.0