mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/hiredis: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1,2 +1 @@
|
||||
DIST hiredis-2.0.0.tar.gz 75807 BLAKE2B dc7535f117c8ecfb2c924fe44a1cba2f02271c544588249de6794ce3aec27f66038ecb9f6364ca87b71f66ba13870a3be192eb79c1f360d2eb6dcb6dcae41caa SHA512 b9a313acdd00676dc046713a81bbf4336959f49f09bd2828997c23ca41259935047c657a4b6f81913715141a75fb6bbe7fc4429c7a5b0f4bc3d5de66b9cfa909
|
||||
DIST hiredis-2.2.2.gh.tar.gz 18010 BLAKE2B 67ab7c3f0667d3cf33abea58fbe37bcc28beb569f6f3da966f191d00965faa5a835a286172179d6f33f4e0fa81743fa345829f04d9d89350ab1394cc0c168147 SHA512 8a42df63911000cd119da33e7fea25fa1a5244a86016818bcb6c6e12c042b12b00b7272633d85dcf921fd2eba67145e3258c64689be799a0f59766e541139120
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
--- 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);
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--- hiredis-2.0.0/setup.py
|
||||
+++ hiredis-2.0.0/setup.py
|
||||
@@ -11,9 +11,8 @@
|
||||
return module.__version__
|
||||
|
||||
ext = Extension("hiredis.hiredis",
|
||||
- sources=sorted(glob.glob("src/*.c") +
|
||||
- ["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
|
||||
- include_dirs=["vendor"])
|
||||
+ sources=sorted(glob.glob("src/*.c")),
|
||||
+ libraries=["hiredis"])
|
||||
|
||||
setup(
|
||||
name="hiredis",
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} 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 ~riscv ~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"
|
||||
}
|
||||
@@ -13,7 +13,4 @@
|
||||
<remote-id type="pypi">hiredis</remote-id>
|
||||
<remote-id type="github">redis/hiredis-py</remote-id>
|
||||
</upstream>
|
||||
<use>
|
||||
<flag name="system-libs">Use <pkg>dev-libs/hiredis</pkg> from system</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
|
||||
Reference in New Issue
Block a user