summaryrefslogtreecommitdiff
path: root/dev-python/hiredis
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-11-03 06:47:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-11-03 06:47:15 +0000
commitfc2f1018fc323ef2c6572734a9b130427cba76a6 (patch)
treef834bdc9a67923ce75297c09d00d1e7b90791d26 /dev-python/hiredis
parent162945d2a91899b637bbb9e163b406350de12906 (diff)
gentoo resync : 03.11.2021
Diffstat (limited to 'dev-python/hiredis')
-rw-r--r--dev-python/hiredis/Manifest2
-rw-r--r--dev-python/hiredis/files/hiredis-2.0.0-CVE-2021-32765.patch36
-rw-r--r--dev-python/hiredis/hiredis-2.0.0-r2.ebuild36
3 files changed, 74 insertions, 0 deletions
diff --git a/dev-python/hiredis/Manifest b/dev-python/hiredis/Manifest
index 0d17e62783cc..e7ae4e13ac1d 100644
--- a/dev-python/hiredis/Manifest
+++ b/dev-python/hiredis/Manifest
@@ -1,4 +1,6 @@
+AUX hiredis-2.0.0-CVE-2021-32765.patch 923 BLAKE2B ea62b3f4ca1ea622ea9eed89af3ee267b0e5355093c872e582346130c3107e6cd109b8a266c68b79c00440f550f3a73c3c1c12d3cb3cd3c61fd22289532d5349 SHA512 7ad798620f7cfd62aad7d73568410f04001edd70ea2a3cfe26242b309f4dafb44dd78e9de399a050e12164ebbe8160ed324f594ec4d1cf44b5a7b5b70d27d9b3
AUX hiredis-2.0.0-system-libs.patch 390 BLAKE2B bf64bb9ad6ca84c5cdabe505dfed0417e71d9585cd60c0fa2bd9627b2cb90f8502f5224d5854a14213a5b4a9e01814e23d2295dba0acc122102181fab955297c SHA512 04521b844c346f86a44608bca76f706ec5f70a35c6ce2678fd7c4b958e6053d56aac0fca0d301ec8bed6aaa369c883370ffb946930d46d0fc8c0f7f9e52f7bed
DIST hiredis-2.0.0.tar.gz 75807 BLAKE2B dc7535f117c8ecfb2c924fe44a1cba2f02271c544588249de6794ce3aec27f66038ecb9f6364ca87b71f66ba13870a3be192eb79c1f360d2eb6dcb6dcae41caa SHA512 b9a313acdd00676dc046713a81bbf4336959f49f09bd2828997c23ca41259935047c657a4b6f81913715141a75fb6bbe7fc4429c7a5b0f4bc3d5de66b9cfa909
EBUILD hiredis-2.0.0-r1.ebuild 766 BLAKE2B 8f2490a173d7a9075c1e8dce3568c6ed2bc8bd9a7e32629374f487a93404dfec45ce1cdca0f82838279359e18161d7db405cd9bc9783b66432f3073d8311d8ff SHA512 b067a121e0662e1eb7a96329ab1ae238c50246d7e913e2f921ad2497eaca56574de7dbcb417c31b2db424b3f84fdc2fd6ae0ec1d86d0d9b5ff15d8188c0143ec
+EBUILD hiredis-2.0.0-r2.ebuild 822 BLAKE2B 8e20a21a5de75e3558ed6174f010244c914363c7c61607163f3ddfbe9abfa4ea8afb8118b1cd6d73dea954bdbda805ef66a551f623a2c38b0c33564d06a408ec SHA512 b244f40e2615331ec60d57e220e7814eca6a51354814155dde1dd56b9644b4b7092938d0cd2b2a209f99d5fb20056899bd5dbe8d98c80f92865581e457bdc8b7
MISC metadata.xml 579 BLAKE2B a625bee5874cd1b4944638094c6f13b7c1aa6c55333e3d0de088e8c2e85c43f212c78ea495470d78e1f143bcd7f1be50c4bf16c616912fbacdcffb90e1cff992 SHA512 db00dee480df0e1c8c553e592c6ef5f931329247cc35842753dbd755a0d825cc6a14b67713fa133a6f3048326e039faede1fba290015f09df3e057ee3949f064
diff --git a/dev-python/hiredis/files/hiredis-2.0.0-CVE-2021-32765.patch b/dev-python/hiredis/files/hiredis-2.0.0-CVE-2021-32765.patch
new file mode 100644
index 000000000000..ad1bb80ac0de
--- /dev/null
+++ b/dev-python/hiredis/files/hiredis-2.0.0-CVE-2021-32765.patch
@@ -0,0 +1,36 @@
+--- a/vendor/hiredis/alloc.c
++++ b/vendor/hiredis/alloc.c
+@@ -68,6 +68,10 @@ void *hi_malloc(size_t size) {
+ }
+
+ void *hi_calloc(size_t nmemb, size_t size) {
++ /* Overflow check as the user can specify any arbitrary allocator */
++ if (SIZE_MAX / size < nmemb)
++ return NULL;
++
+ return hiredisAllocFns.callocFn(nmemb, size);
+ }
+
+diff --git a/alloc.h b/alloc.h
+index 34a05f4..771f9fe 100644
+--- a/vendor/hiredis/alloc.h
++++ b/vendor/hiredis/alloc.h
+@@ -32,6 +32,7 @@
+ #define HIREDIS_ALLOC_H
+
+ #include <stddef.h> /* for size_t */
++#include <stdint.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+@@ -59,6 +60,10 @@ static inline void *hi_malloc(size_t size) {
+ }
+
+ static inline void *hi_calloc(size_t nmemb, size_t size) {
++ /* Overflow check as the user can specify any arbitrary allocator */
++ if (SIZE_MAX / size < nmemb)
++ return NULL;
++
+ return hiredisAllocFns.callocFn(nmemb, size);
+ }
+
diff --git a/dev-python/hiredis/hiredis-2.0.0-r2.ebuild b/dev-python/hiredis/hiredis-2.0.0-r2.ebuild
new file mode 100644
index 000000000000..48e177fb23f1
--- /dev/null
+++ b/dev-python/hiredis/hiredis-2.0.0-r2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+inherit distutils-r1
+
+DESCRIPTION="Python extension that wraps hiredis"
+HOMEPAGE="https://github.com/redis/hiredis-py/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="system-libs"
+
+DEPEND="system-libs? ( >=dev-libs/hiredis-1.0.0:= )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-CVE-2021-32765.patch
+)
+
+src_prepare() {
+ use system-libs && PATCHES+=(
+ "${FILESDIR}"/${P}-system-libs.patch
+ )
+ sed -i -e 's:description-file:description_file:' setup.cfg || die
+ default
+}
+
+python_test() {
+ cd test || die
+ "${EPYTHON}" -m unittest -v reader.ReaderTest || die "tests failed"
+}