commit libcares2 for openSUSE:Factory
Hello community, here is the log from the commit of package libcares2 for openSUSE:Factory checked in at Mon Mar 21 09:48:27 CET 2011. -------- --- libcares2/libcares2.changes 2010-12-13 17:22:36.000000000 +0100 +++ /mounts/work_src_done/STABLE/libcares2/libcares2.changes 2011-03-19 22:19:45.000000000 +0100 @@ -1,0 +2,6 @@ +Sat Mar 19 21:16:09 UTC 2011 - crrodriguez@opensuse.org + +- fix NULL ptr dereference + + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- 0022-advance_tcp_send_queue-avoid-NULL-ptr-dereference.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libcares2.spec ++++++ --- /var/tmp/diff_new_pack.xBAUFn/_old 2011-03-21 09:39:28.000000000 +0100 +++ /var/tmp/diff_new_pack.xBAUFn/_new 2011-03-21 09:39:28.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package libcares2 (Version 1.7.4) +# spec file for package libcares2 # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ Name: libcares2 Version: 1.7.4 -Release: 1 +Release: 7 License: MIT License (or similar) BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Development/Libraries/C and C++ @@ -30,6 +30,7 @@ Source: http://daniel.haxx.se/projects/c-ares/%{pkg_name}-%{version}.tar.bz2 Source2: baselibs.conf BuildRequires: pkg-config +Patch: 0022-advance_tcp_send_queue-avoid-NULL-ptr-dereference.patch %description c-ares is a C library that performs DNS requests and name resolves @@ -49,6 +50,7 @@ %prep %setup -q -n %{pkg_name}-%{version} +%patch -p1 %build %configure --enable-symbol-hiding --enable-nonblocking --enable-shared --disable-static --with-pic ++++++ 0022-advance_tcp_send_queue-avoid-NULL-ptr-dereference.patch ++++++
From 366cd6d54dfdf0d487f60333c45e9c7da9327050 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg <daniel@haxx.se> Date: Mon, 27 Dec 2010 13:10:48 +0100 Subject: [PATCH 22/34] advance_tcp_send_queue: avoid NULL ptr dereference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
If given a too large 'num_bytes' value, it would cause a NULL ptr dereference. Instead the code will now break out of the loop at the end of the list. Signed-off-by: Cristian Rodríguez <cristian.rodriguez@opensuse.org> --- ares_process.c | 43 +++++++++++++++++++++---------------------- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ares_process.c b/ares_process.c index 7d04eff..ca4c8ee 100644 --- a/ares_process.c +++ b/ares_process.c @@ -300,29 +300,28 @@ static void advance_tcp_send_queue(ares_channel channel, int whichserver, { struct send_request *sendreq; struct server_state *server = &channel->servers[whichserver]; - while (num_bytes > 0) - { - sendreq = server->qhead; - if ((size_t)num_bytes >= sendreq->len) - { - num_bytes -= sendreq->len; - server->qhead = sendreq->next; - if (server->qhead == NULL) - { - SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0); - server->qtail = NULL; - } - if (sendreq->data_storage != NULL) - free(sendreq->data_storage); - free(sendreq); - } - else - { - sendreq->data += num_bytes; - sendreq->len -= num_bytes; - num_bytes = 0; - } + while (num_bytes > 0) { + sendreq = server->qhead; + if ((size_t)num_bytes >= sendreq->len) { + num_bytes -= sendreq->len; + server->qhead = sendreq->next; + if (sendreq->data_storage) + free(sendreq->data_storage); + free(sendreq); + if (server->qhead == NULL) { + SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0); + server->qtail = NULL; + + /* qhead is NULL so we cannot continue this loop */ + break; + } + } + else { + sendreq->data += num_bytes; + sendreq->len -= num_bytes; + num_bytes = 0; } + } } /* If any TCP socket selects true for reading, read some data, -- 1.7.4.1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de