]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
prevent information leak off the stack
authorAndrew Tridgell <andrew@tridgell.net>
Wed, 13 Nov 2024 22:57:08 +0000 (09:57 +1100)
committerAndrew Tridgell <andrew@tridgell.net>
Tue, 14 Jan 2025 18:30:32 +0000 (05:30 +1100)
prevent leak of uninitialised stack data in hash_search

match.c

diff --git a/match.c b/match.c
index 36e78ed2b3c2b058d514964a74737b368b8668c3..dfd6af2c979ccca52b34fd32b8af1fa6a992f1d9 100644 (file)
--- a/match.c
+++ b/match.c
@@ -147,6 +147,9 @@ static void hash_search(int f,struct sum_struct *s,
        int more;
        schar *map;
 
+       // prevent possible memory leaks
+       memset(sum2, 0, sizeof sum2);
+
        /* want_i is used to encourage adjacent matches, allowing the RLL
         * coding of the output to work more efficiently. */
        want_i = 0;