aboutsummaryrefslogtreecommitdiffstats
path: root/main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch')
-rw-r--r--main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch23
1 files changed, 0 insertions, 23 deletions
diff --git a/main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch b/main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch
deleted file mode 100644
index 582607c32a..0000000000
--- a/main/librsync/Fix-heap-corruption-from-too-small-kbloom.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From d89f2cd4714f717e6cc5468c6066e18f22b5fea6 Mon Sep 17 00:00:00 2001
-From: ljusten <ljusten@google.com>
-Date: Mon, 21 Sep 2020 17:52:58 +0200
-Subject: [PATCH] Fix heap corruption from too small kbloom
-
-kbloom is a bitmask with 'size2' bits, where 'size2' is the next power of 2 of 'size'. Thus, if 'size' is smaller than 4, 'size2' is smaller than 8, so that size2 / 8 == 0 and calloc allocates 0 bytes. This causes heap corruption when kbloom is subsequently written to. See discussion on https://groups.google.com/g/librsync/c/vmqzQS1QjIw.
----
- src/hashtable.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/hashtable.c b/src/hashtable.c
-index 4ffd9bf..ff3f29c 100644
---- a/src/hashtable.c
-+++ b/src/hashtable.c
-@@ -52,7 +52,7 @@ hashtable_t *_hashtable_new(int size)
- t->count = 0;
- t->tmask = size2 - 1;
- #ifndef HASHTABLE_NBLOOM
-- if (!(t->kbloom = calloc(size2 / 8, sizeof(unsigned char)))) {
-+ if (!(t->kbloom = calloc((size2 + 7) / 8, sizeof(unsigned char)))) {
- _hashtable_free(t);
- return NULL;
- }