c-ares/backport-003-CVE-2023-31147.patch
xinghe 5e7a75f74c fix CVE-2023-31130 CVE-2023-31124 CVE-2023-31147
(cherry picked from commit ee7b9f0233249789e5736ddeec69ed70cd6e5452)
2023-06-12 13:37:18 +08:00

33 lines
1.1 KiB
Diff

From 00f47ed830fc22775ffdc2bc2a691372684fae4f Mon Sep 17 00:00:00 2001
From: bradh352 <brad@brad-house.com>
Date: Mon, 22 May 2023 07:02:59 -0400
Subject: [PATCH] ares_rand static analysis fixes from CI
Conflict: src/lib/ares_rand.c -> ares_rand.c
Reference: https://github.com/c-ares/c-ares/commit/00f47ed830fc22775ffdc2bc2a691372684fae4f
---
ares_rand.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ares_rand.c b/ares_rand.c
index a564bc23..a55a90bf 100644
--- a/ares_rand.c
+++ b/ares_rand.c
@@ -125,7 +125,7 @@ static void ares_rc4_init(ares_rand_rc4 *rc4_state)
}
/* Just outputs the key schedule, no need to XOR with any data since we have none */
-static void ares_rc4_prng(ares_rand_rc4 *rc4_state, unsigned char *buf, int len)
+static void ares_rc4_prng(ares_rand_rc4 *rc4_state, unsigned char *buf, size_t len)
{
unsigned char *S = rc4_state->S;
size_t i = rc4_state->i;
@@ -225,7 +225,6 @@ static void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t
{
while (1) {
- size_t rv;
size_t bytes_read = 0;
switch (state->type) {