Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Jakub Hrozek | bcd34ead56 | |
Jakub Hrozek | 1530b04b6a | |
Jakub Hrozek | 13e86ddad9 | |
Jakub Hrozek | f42ed59831 |
|
@ -0,0 +1,28 @@
|
|||
From 293cd3170019015b6ce40f9fa5efc45bd89dad1a Mon Sep 17 00:00:00 2001
|
||||
From: Ben Greear <greearb@candelatech.com>
|
||||
Date: Tue, 24 Aug 2010 16:48:47 -0700
|
||||
Subject: [PATCH] Add missing break that caused get_ares_servers to fail.
|
||||
|
||||
Reported-by: Ning Dong <flintning@163.com>
|
||||
Signed-off-by: Ben Greear <greearb@candelatech.com>
|
||||
---
|
||||
ares_data.c | 3 ++-
|
||||
1 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/ares_data.c b/ares_data.c
|
||||
index 6b6fae8..a2477be 100644
|
||||
--- a/ares_data.c
|
||||
+++ b/ares_data.c
|
||||
@@ -145,7 +145,8 @@ void *ares_malloc_data(ares_datatype type)
|
||||
ptr->data.addr_node.next = NULL;
|
||||
ptr->data.addr_node.family = 0;
|
||||
memset(&ptr->data.addr_node.addrV6, 0,
|
||||
- sizeof(ptr->data.addr_node.addrV6));
|
||||
+ sizeof(ptr->data.addr_node.addrV6));
|
||||
+ break;
|
||||
|
||||
default:
|
||||
free(ptr);
|
||||
--
|
||||
1.7.2.1
|
||||
|
18
c-ares.spec
18
c-ares.spec
|
@ -1,7 +1,7 @@
|
|||
Summary: A library that performs asynchronous DNS operations
|
||||
Name: c-ares
|
||||
Version: 1.7.3
|
||||
Release: 1%{?dist}
|
||||
Release: 4%{?dist}
|
||||
License: MIT
|
||||
Group: System Environment/Libraries
|
||||
URL: http://c-ares.haxx.se/
|
||||
|
@ -9,6 +9,10 @@ Source0: http://c-ares.haxx.se/c-ares-%{version}.tar.gz
|
|||
Source1: LICENSE
|
||||
Patch0: %{name}-1.7.0-optflags.patch
|
||||
Patch1: c-ares-multilib.patch
|
||||
# upstream patches from 1.4 development
|
||||
Patch2: 0001-Add-missing-break-that-caused-get_ares_servers-to-fa.patch
|
||||
Patch3: cleanup-avoid-unsafe-typecasts.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
%description
|
||||
|
@ -23,13 +27,15 @@ Requires: %{name} = %{version}-%{release}
|
|||
Requires: pkgconfig
|
||||
|
||||
%description devel
|
||||
This package contains the header files and static libraries needed to
|
||||
This package contains the header files and libraries needed to
|
||||
compile applications or shared objects that use c-ares.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .optflags
|
||||
%patch1 -p1 -b .multilib
|
||||
%patch2 -p1 -b .get_servers
|
||||
%patch3 -p1 -b .typecasts
|
||||
cp %{SOURCE1} .
|
||||
f=CHANGES ; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
|
||||
|
||||
|
@ -66,6 +72,14 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_mandir}/man3/ares_*
|
||||
|
||||
%changelog
|
||||
* Mon Apr 11 2011 Jakub Hrozek <jhrozek@redhat.com> - 1.7.3-4
|
||||
- Apply upstream patch to fix rhbz#695424
|
||||
* Wed Aug 25 2010 Jakub Hrozek <jhrozek@redhat.com> - 1.7.3-3
|
||||
- Actually apply the patches
|
||||
|
||||
* Wed Aug 25 2010 Jakub Hrozek <jhrozek@redhat.com> - 1.7.3-2
|
||||
- fix ares_get_servers
|
||||
|
||||
* Tue Jun 15 2010 Jakub Hrozek <jhrozek@redhat.com> - 1.7.3-1
|
||||
- Upgrade to new upstream release 1.7.3 (obsoletes search/domain patch)
|
||||
- Fix conflict of -devel packages on multilib architectures (#602880)
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
From 2d5ed6400ba430f412ebc9748eb847771907776d Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Sat, 18 Dec 2010 22:20:16 +0100
|
||||
Subject: [PATCH] cleanup: avoid unsafe typecasts
|
||||
|
||||
Avoid the risk of reading 16bit data from an unaligned address by using
|
||||
a macro that is adapted for this.
|
||||
---
|
||||
ares_parse_mx_reply.c | 4 ++--
|
||||
ares_parse_srv_reply.c | 6 +++---
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/ares_parse_mx_reply.c b/ares_parse_mx_reply.c
|
||||
index 186ddd3..2180054 100644
|
||||
--- a/ares_parse_mx_reply.c
|
||||
+++ b/ares_parse_mx_reply.c
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
int
|
||||
ares_parse_mx_reply (const unsigned char *abuf, int alen,
|
||||
- struct ares_mx_reply **mx_out)
|
||||
+ struct ares_mx_reply **mx_out)
|
||||
{
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr, *vptr;
|
||||
@@ -134,7 +134,7 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen,
|
||||
mx_last = mx_curr;
|
||||
|
||||
vptr = aptr;
|
||||
- mx_curr->priority = ntohs (*((unsigned short *)vptr));
|
||||
+ mx_curr->priority = DNS__16BIT(vptr);
|
||||
vptr += sizeof(unsigned short);
|
||||
|
||||
status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len);
|
||||
diff --git a/ares_parse_srv_reply.c b/ares_parse_srv_reply.c
|
||||
index 7d443b3..9c7eb6e 100644
|
||||
--- a/ares_parse_srv_reply.c
|
||||
+++ b/ares_parse_srv_reply.c
|
||||
@@ -139,11 +139,11 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen,
|
||||
srv_last = srv_curr;
|
||||
|
||||
vptr = aptr;
|
||||
- srv_curr->priority = ntohs (*((unsigned short *)vptr));
|
||||
+ srv_curr->priority = DNS__16BIT(vptr);
|
||||
vptr += sizeof(unsigned short);
|
||||
- srv_curr->weight = ntohs (*((unsigned short *)vptr));
|
||||
+ srv_curr->weight = DNS__16BIT(vptr);
|
||||
vptr += sizeof(unsigned short);
|
||||
- srv_curr->port = ntohs (*((unsigned short *)vptr));
|
||||
+ srv_curr->port = DNS__16BIT(vptr);
|
||||
vptr += sizeof(unsigned short);
|
||||
|
||||
status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len);
|
||||
--
|
||||
1.7.4.2
|
||||
|
Loading…
Reference in New Issue