summaryrefslogtreecommitdiff
path: root/CVE-2019-10193.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-06-09 08:41:05 +0000
committerCoprDistGit <infra@openeuler.org>2023-06-09 08:41:05 +0000
commit4d2e143b15fdc8f316a1eef5a8b1053981f6d256 (patch)
tree10203472e783180b6364499f88ef2906b18b0049 /CVE-2019-10193.patch
parentd7609b0abb011ea9d856ca663892f0f88d211f78 (diff)
automatic import of redisopeneuler20.03
Diffstat (limited to 'CVE-2019-10193.patch')
-rw-r--r--CVE-2019-10193.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/CVE-2019-10193.patch b/CVE-2019-10193.patch
new file mode 100644
index 0000000..80edfd3
--- /dev/null
+++ b/CVE-2019-10193.patch
@@ -0,0 +1,30 @@
+From 4c7eda965af7f231148219267c9b039d06cab519 Mon Sep 17 00:00:00 2001
+From: antirez <antirez@gmail.com>
+Date: Fri, 15 Mar 2019 17:10:16 +0100
+Subject: [PATCH] HyperLogLog: enlarge reghisto variable for safety.
+
+---
+ src/hyperloglog.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/hyperloglog.c b/src/hyperloglog.c
+index 68d591c..24cf81a 100644
+--- a/src/hyperloglog.c
++++ b/src/hyperloglog.c
+@@ -1011,7 +1011,12 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
+ double E;
+ int j;
+ double alphaInf = 0.5 / log(2.);
+- int reghisto[HLL_Q+2] = {0};
++ /* Note that reghisto could be just HLL_Q+1, becuase this is the
++ * maximum frequency of the "000...1" sequence the hash function is
++ * able to return. However it is slow to check for sanity of the
++ * input: instead we history array at a safe size: overflows will
++ * just write data to wrong, but correctly allocated, places. */
++ int reghisto[64] = {0};
+
+ /* Compute register histogram */
+ if (hdr->encoding == HLL_DENSE) {
+--
+2.23.0
+