Commit 97ffe527 authored by Leo's avatar Leo
Browse files

main/librsync: upgrade to 2.3.2

parent 9f3db2f1
# Contributor: Jeremy Thomerson <jeremy@thomersonfamily.com>
# Maintainer: Jeremy Thomerson <jeremy@thomersonfamily.com>
pkgname=librsync
pkgver=2.3.1
pkgrel=1
pkgver=2.3.2
pkgrel=0
pkgdesc="librsync implements the rolling-checksum algorithm of rsync"
url="https://github.com/librsync/librsync"
arch="all"
......@@ -10,7 +10,6 @@ license="LGPL-2.1-or-later"
makedepends="cmake popt-dev bzip2-dev zlib-dev perl"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/librsync/librsync/archive/v$pkgver.tar.gz
Fix-heap-corruption-from-too-small-kbloom.patch
"
prepare() {
......@@ -37,5 +36,4 @@ package() {
install -D -m644 doc/librsync.3 "$pkgdir/usr/share/man/man3/librsync.3"
}
sha512sums="89e5b5ad960b8036acce41df09f5e50601d7eb57d48a2bd21c4ee54a3a375f62ee514036b9a562277b5656735b84cadf6f54cbf48c364bbf0c04f2d95ae3b5a6 librsync-2.3.1.tar.gz
4a5c21ed149da9aee720d4e9b178a34f4d7c9e6b94de629216ca59d0b7bd831b04bcb4b5b138e6a224a060c5aa51dc8f621623031d3bbbb7b97556a6164b95d1 Fix-heap-corruption-from-too-small-kbloom.patch"
sha512sums="77d826dbaf02061b759d876a6b537238bad40379a08e4494ebfd3e380b2eb921b7b060bc570330aeac9424ef1a9d521f449d559c9ffa3be24acdef4ad530fe90 librsync-2.3.2.tar.gz"
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment