!8 升级c-ares到1.16.1版本

Merge pull request !8 from eaglegai/openEuler-20.03-LTS
This commit is contained in:
openeuler-ci-bot 2020-08-28 11:56:01 +08:00 committed by Gitee
commit 6d6556ba04
7 changed files with 88 additions and 4 deletions

View File

@ -0,0 +1,38 @@
From 4c02944ef1cedb9460825d28b4e5c27988d04dba Mon Sep 17 00:00:00 2001
From: Ivan Baidakou <the.dmol@yandex.by>
Date: Tue, 12 May 2020 14:22:33 +0300
Subject: [PATCH] Fix: sizeof(sizeof(addr.saX)) -> sizeof(addr.saX) in
readaddrinfo (#331)
Looks like a sed-gone-wrong, a sizeof inside of a sizeof.
Fix By: Ivan Baidakou (@basiliscos)
---
ares__readaddrinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ares__readaddrinfo.c b/ares__readaddrinfo.c
index dd3abe2..89fea83 100644
--- a/ares__readaddrinfo.c
+++ b/ares__readaddrinfo.c
@@ -179,7 +179,7 @@ int ares__readaddrinfo(FILE *fp,
}
node->ai_family = addr.sa.sa_family = AF_INET;
- node->ai_addrlen = sizeof(sizeof(addr.sa4));
+ node->ai_addrlen = sizeof(addr.sa4);
node->ai_addr = ares_malloc(sizeof(addr.sa4));
if (!node->ai_addr)
{
@@ -200,7 +200,7 @@ int ares__readaddrinfo(FILE *fp,
}
node->ai_family = addr.sa.sa_family = AF_INET6;
- node->ai_addrlen = sizeof(sizeof(addr.sa6));
+ node->ai_addrlen = sizeof(addr.sa6);
node->ai_addr = ares_malloc(sizeof(addr.sa6));
if (!node->ai_addr)
{
--
1.8.3.1

View File

@ -0,0 +1,38 @@
From 6d6cd5daf63b812734343bd020677829b13db2ac Mon Sep 17 00:00:00 2001
From: Fionn Fitzmaurice <1897918+fionn@users.noreply.github.com>
Date: Fri, 3 Jul 2020 07:39:54 +0800
Subject: [PATCH] Avoid buffer overflow in RC4 loop comparison (#336)
The rc4 function iterates over a buffer of size buffer_len who's maximum
value is INT_MAX with a counter of type short that is not guaranteed to
have maximum size INT_MAX.
In circumstances where short is narrower than int and where buffer_len
is larger than the maximum value of a short, it may be possible to loop
infinitely as counter will overflow and never be greater than or equal
to buffer_len.
The solution is to make the comparison be between types of equal width.
This commit defines counter as an int.
Fix By: Fionn Fitzmaurice (@fionn)
---
ares_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ares_query.c b/ares_query.c
index b38b8a6..5bbb2f5 100644
--- a/ares_query.c
+++ b/ares_query.c
@@ -45,7 +45,7 @@ static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
unsigned char y;
unsigned char* state;
unsigned char xorIndex;
- short counter;
+ int counter;
x = key->x;
y = key->y;
--
1.8.3.1

Binary file not shown.

BIN
c-ares-1.16.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: c-ares Name: c-ares
Version: 1.16.0 Version: 1.16.1
Release: 2 Release: 1
Summary: A C library for asynchronous DNS requests Summary: A C library for asynchronous DNS requests
License: MIT License: MIT
@ -9,8 +9,10 @@ Source0: https://github.com/c-ares/c-ares/releases/tag/%{name}-%{version}
BuildRequires: gcc autoconf automake libtool BuildRequires: gcc autoconf automake libtool
# Patch0 from Redhat is applied for stopping overriding AC_CONFIG_MACRO_DIR # Patch0 from Redhat is applied for stopping overriding AC_CONFIG_MACRO_DIR
Patch0: 0001-Use-RPM-compiler-options.patch Patch0: 0000-Use-RPM-compiler-options.patch
Patch1: 0002-Fix-invalid-read-in-ares_parse_soa_reply.patch Patch1: 0001-Fix-invalid-read-in-ares_parse_soa_reply.patch
Patch2: 0002-Fix-sizeof-sizeof-addr.saX-sizeof-addr.saX-in-readad.patch
Patch3: 0003-Avoid-buffer-overflow-in-RC4-loop-comparison-336.patch
%description %description
This is c-ares, an asynchronous resolver library. It is intended for applications This is c-ares, an asynchronous resolver library. It is intended for applications
which need to perform DNS queries without blocking, or need to perform multiple which need to perform DNS queries without blocking, or need to perform multiple
@ -53,6 +55,12 @@ make %{?_smp_mflags}
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Tue Aug 25 2020 gaihuiying <gaihuiying1@huawei.com> - 1.16.1-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update c-ares version to 1.16.1
* Sat May 23 2020 lutianxiong<lutianxiong@huawei.com> - 1.16.0-2 * Sat May 23 2020 lutianxiong<lutianxiong@huawei.com> - 1.16.0-2
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA