Hello community,

here is the log from the commit of package libevent for openSUSE:Factory 
checked in at 2012-11-18 20:30:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libevent (Old)
 and      /work/SRC/openSUSE:Factory/.libevent.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libevent", Maintainer is "meiss...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libevent/libevent.changes        2012-08-04 
09:20:52.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libevent.new/libevent.changes   2012-11-18 
20:30:18.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Nov 16 21:24:42 UTC 2012 - andreas.stie...@gmx.de
+
+- update to 2.0.20
+  * core: Make event_pending() threadsafe
+  * evhttp: Fix a memory leak on error in evhttp_uriencode
+  * evbuffer: Avoid possible needless call to writev
+  * evdns: memset sockaddr_in before using it
+  * evhttp: Check more setsockopt return values when binding sockets
+  * evdns: Avoid segfault on weird timeout during name lookup
+  * bufferevent_ssl: Correctly invoke callbacks when a SSL
+    bufferevent reads some and then blocks
+
+-------------------------------------------------------------------

Old:
----
  libevent-2.0.19-stable.tar.gz

New:
----
  libevent-2.0.20-stable.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libevent.spec ++++++
--- /var/tmp/diff_new_pack.PlXZjH/_old  2012-11-18 20:30:19.000000000 +0100
+++ /var/tmp/diff_new_pack.PlXZjH/_new  2012-11-18 20:30:19.000000000 +0100
@@ -19,13 +19,13 @@
 Name:           libevent
 %define         libsoname %{name}-2_0-5
 
-Version:        2.0.19
+Version:        2.0.20
 Release:        0
 Summary:        Library Providing an Event Handling API
 License:        BSD-3-Clause
 Group:          Development/Libraries/C and C++
-Url:            http://monkey.org/~provos/libevent/
-Source0:        
http://cloud.github.com/downloads/libevent/libevent/%{name}-%{version}-stable.tar.gz
+Url:            http://libevent.org/
+Source0:        
https://github.com/downloads/libevent/libevent/%{name}-%{version}-stable.tar.gz
 Source1:        baselibs.conf 
 BuildRequires:  openssl-devel
 BuildRequires:  pkgconfig

++++++ libevent-2.0.19-stable.tar.gz -> libevent-2.0.20-stable.tar.gz ++++++
++++ 2025 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/ChangeLog new/libevent-2.0.20-stable/ChangeLog
--- old/libevent-2.0.19-stable/ChangeLog        2012-05-03 18:26:20.000000000 
+0200
+++ new/libevent-2.0.20-stable/ChangeLog        2012-08-23 18:40:49.000000000 
+0200
@@ -1,3 +1,39 @@
+Changes in version 2.0.20-stable (?? Aug 2012)
+BUGFIXES:
+ o core: Make event_pending() threadsafe. (be7a95c Simon Liu)
+ o win32: avoid crash when waiting forever on zero fds. (160e58b)
+ o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31)
+ o evbuffer: Avoid possible needless call to writev. Found by coverity. 
(6a4ec5c)
+ o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67)
+ o evhttp: Check more setsockopt return values when binding sockets. Found by 
coverity (a0912e3)
+ o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg 
Hazel)
+ o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads 
some and then blocks. (606ac43)
+
+
+PORTABILITY FIXES:
+ o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel)
+ o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn)
+ o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose 
$(SED) (ca80ea6)
+
+BUILD FIXES:
+ o Add GCC annotations so that the vsprintf functions get checked properly 
(117e327)
+ o Fix an unused variable warning on *BSD. (c0720c1)
+
+UNIT TEST FIXES:
+ o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall)
+ o Remove deadcode in http regression tests. Found by coverity. (5553346)
+ o Fix possible uninitialized read in dns regression tests. Found by coverity. 
(2259777)
+ o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d)
+ o Fix various check-after-dereference issues in unit tests: found by coverity 
(4f3732d)
+ o Fix resource leaks in the unit tests; found by coverity (270f279)
+ o Add some missing null checks to unit tests; found by coverity (f021c3d)
+ o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf)
+ o Remove unused variable; spotted by coverity (6355b2a)
+ o Add checks to various return values in unit tests. Found by coverity 
(b9e7329)
+ o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. 
(a2006c0)
+
+
+
 Changes in version 2.0.19-stable (3 May 2012)
 BUGFIXES (CORE):
  o Refactor event_persist_closure: raise and extract some common logic 
(bec22b4)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/Makefile.am new/libevent-2.0.20-stable/Makefile.am
--- old/libevent-2.0.19-stable/Makefile.am      2012-05-03 18:28:02.000000000 
+0200
+++ new/libevent-2.0.20-stable/Makefile.am      2012-08-23 20:36:11.000000000 
+0200
@@ -38,7 +38,7 @@
 #
 # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
 # UNLESS YOU REALLY REALLY HAVE TO.
-VERSION_INFO = 6:7:1
+VERSION_INFO = 6:8:1
 
 # History:          RELEASE    VERSION_INFO
 #  2.0.1-alpha --     2.0        1:0:0
@@ -60,6 +60,7 @@
 #  2.0.17-stable--    2.0        6:5:1 (No ABI change)
 #  2.0.18-stable--    2.0        6:6:1 (No ABI change)
 #  2.0.19-stable--    2.0        6:7:1 (No ABI change)
+#  2.0.20-stable--    2.0        6:8:1 (No ABI change)
 #
 # For Libevent 2.1:
 #  2.1.1-alpha --     2.1        1:0:0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/README new/libevent-2.0.20-stable/README
--- old/libevent-2.0.19-stable/README   2012-05-02 23:08:15.000000000 +0200
+++ new/libevent-2.0.20-stable/README   2012-08-23 16:36:20.000000000 +0200
@@ -91,6 +91,7 @@
   Lawnstein Chan
   Shuo Chen
   Ka-Hing Cheung
+  Andrew Cox
   Andrew Danforth
   Ed Day
   Christopher Davis
@@ -104,13 +105,14 @@
   Remi Gacogne
   Alexander von Gernler
   Artur Grabowski
+  Sebastian Hahn
   Dave Hart
   Greg Hazel
   Michael Herf
-  Sebastian Hahn
   Savg He
   Mark Heily
   Greg Hewgill
+  Andrew Hochhaus
   Aaron Hopkins
   Tani Hosokawa
   Jamie Iles
@@ -131,6 +133,7 @@
   David Libenzi
   Yan Lin
   Moshe Litvin
+  Simon Liu
   Mitchell Livingston
   Hagne Mahre
   Lubomir Marinov
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/WIN32-Code/event2/event-config.h 
new/libevent-2.0.20-stable/WIN32-Code/event2/event-config.h
--- old/libevent-2.0.19-stable/WIN32-Code/event2/event-config.h 2012-05-03 
18:27:14.000000000 +0200
+++ new/libevent-2.0.20-stable/WIN32-Code/event2/event-config.h 2012-08-23 
20:36:44.000000000 +0200
@@ -277,7 +277,7 @@
 /* #undef _EVENT_HAVE_WORKING_KQUEUE */
 
 /* Numeric representation of the version */
-#define _EVENT_NUMERIC_VERSION 0x02001300
+#define _EVENT_NUMERIC_VERSION 0x02001400
 
 /* Name of package */
 #define _EVENT_PACKAGE "libevent"
@@ -334,7 +334,7 @@
 #define _EVENT_TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define _EVENT_VERSION "2.0.19-stable"
+#define _EVENT_VERSION "2.0.20-stable"
 
 /* Define to appropriate substitue if compiler doesnt have __func__ */
 #define _EVENT___func__ __FUNCTION__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/buffer.c new/libevent-2.0.20-stable/buffer.c
--- old/libevent-2.0.19-stable/buffer.c 2012-02-10 23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/buffer.c 2012-07-26 16:32:33.000000000 +0200
@@ -2263,6 +2263,8 @@
                }
                chain = chain->next;
        }
+       if (! i)
+               return 0;
 #ifdef WIN32
        {
                DWORD bytesSent;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/bufferevent_openssl.c 
new/libevent-2.0.20-stable/bufferevent_openssl.c
--- old/libevent-2.0.19-stable/bufferevent_openssl.c    2012-05-01 
23:05:51.000000000 +0200
+++ new/libevent-2.0.20-stable/bufferevent_openssl.c    2012-08-23 
16:11:57.000000000 +0200
@@ -556,15 +556,20 @@
        bev_ssl->counts.n_read = num_r;
 }
 
-/* returns -1 on internal error, 0 on stall, 1 on progress */
-static int
-do_read(struct bufferevent_openssl *bev_ssl, int n_to_read)
-{
+#define OP_MADE_PROGRESS 1
+#define OP_BLOCKED 2
+#define OP_ERR 4
+
+/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if
+   we're now blocked); and OP_ERR (if an error occurred). */
+ static int
+do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
        /* Requires lock */
        struct bufferevent *bev = &bev_ssl->bev.bev;
        struct evbuffer *input = bev->input;
-       int r, n, i, n_used = 0, blocked = 0, atmost;
+       int r, n, i, n_used = 0, atmost;
        struct evbuffer_iovec space[2];
+       int result = 0;
 
        atmost = _bufferevent_get_read_max(&bev_ssl->bev);
        if (n_to_read > atmost)
@@ -572,16 +577,17 @@
 
        n = evbuffer_reserve_space(input, n_to_read, space, 2);
        if (n < 0)
-               return -1;
+               return OP_ERR;
 
        for (i=0; i<n; ++i) {
                if (bev_ssl->bev.read_suspended)
                        break;
                r = SSL_read(bev_ssl->ssl, space[i].iov_base, space[i].iov_len);
                if (r>0) {
+                       result |= OP_MADE_PROGRESS;
                        if (bev_ssl->read_blocked_on_write)
                                if (clear_rbow(bev_ssl) < 0)
-                                       return -1;
+                                       return OP_ERR | result;
                        ++n_used;
                        space[i].iov_len = r;
                        decrement_buckets(bev_ssl);
@@ -593,20 +599,20 @@
                                /* Can't read until underlying has more data. */
                                if (bev_ssl->read_blocked_on_write)
                                        if (clear_rbow(bev_ssl) < 0)
-                                               return -1;
+                                               return OP_ERR | result;
                                break;
                        case SSL_ERROR_WANT_WRITE:
                                /* This read operation requires a write, and the
                                 * underlying is full */
                                if (!bev_ssl->read_blocked_on_write)
                                        if (set_rbow(bev_ssl) < 0)
-                                               return -1;
+                                               return OP_ERR | result;
                                break;
                        default:
                                conn_closed(bev_ssl, err, r);
                                break;
                        }
-                       blocked = 1;
+                       result |= OP_BLOCKED;
                        break; /* out of the loop */
                }
        }
@@ -617,16 +623,19 @@
                        BEV_RESET_GENERIC_READ_TIMEOUT(bev);
        }
 
-       return blocked ? 0 : 1;
+       return result;
 }
 
+/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if
+   we're now blocked); and OP_ERR (if an error occurred). */
 static int
 do_write(struct bufferevent_openssl *bev_ssl, int atmost)
 {
-       int i, r, n, n_written = 0, blocked=0;
+       int i, r, n, n_written = 0;
        struct bufferevent *bev = &bev_ssl->bev.bev;
        struct evbuffer *output = bev->output;
        struct evbuffer_iovec space[8];
+       int result = 0;
 
        if (bev_ssl->last_write > 0)
                atmost = bev_ssl->last_write;
@@ -635,7 +644,7 @@
 
        n = evbuffer_peek(output, atmost, NULL, space, 8);
        if (n < 0)
-               return -1;
+               return OP_ERR | result;
 
        if (n > 8)
                n = 8;
@@ -652,9 +661,10 @@
                r = SSL_write(bev_ssl->ssl, space[i].iov_base,
                    space[i].iov_len);
                if (r > 0) {
+                       result |= OP_MADE_PROGRESS;
                        if (bev_ssl->write_blocked_on_read)
                                if (clear_wbor(bev_ssl) < 0)
-                                       return -1;
+                                       return OP_ERR | result;
                        n_written += r;
                        bev_ssl->last_write = -1;
                        decrement_buckets(bev_ssl);
@@ -666,7 +676,7 @@
                                /* Can't read until underlying has more data. */
                                if (bev_ssl->write_blocked_on_read)
                                        if (clear_wbor(bev_ssl) < 0)
-                                               return -1;
+                                               return OP_ERR | result;
                                bev_ssl->last_write = space[i].iov_len;
                                break;
                        case SSL_ERROR_WANT_READ:
@@ -674,7 +684,7 @@
                                 * underlying is full */
                                if (!bev_ssl->write_blocked_on_read)
                                        if (set_wbor(bev_ssl) < 0)
-                                               return -1;
+                                               return OP_ERR | result;
                                bev_ssl->last_write = space[i].iov_len;
                                break;
                        default:
@@ -682,7 +692,7 @@
                                bev_ssl->last_write = -1;
                                break;
                        }
-                       blocked = 1;
+                       result |= OP_BLOCKED;
                        break;
                }
        }
@@ -694,7 +704,7 @@
                if (evbuffer_get_length(output) <= bev->wm_write.low)
                        _bufferevent_run_writecb(bev);
        }
-       return blocked ? 0 : 1;
+       return result;
 }
 
 #define WRITE_FRAME 15000
@@ -754,11 +764,11 @@
 {
        int r;
        int n_to_read;
-       int read_data = 0;
+       int all_result_flags = 0;
 
        while (bev_ssl->write_blocked_on_read) {
                r = do_write(bev_ssl, WRITE_FRAME);
-               if (r <= 0)
+               if (r & (OP_BLOCKED|OP_ERR))
                        break;
        }
        if (bev_ssl->write_blocked_on_read)
@@ -767,10 +777,11 @@
        n_to_read = bytes_to_read(bev_ssl);
 
        while (n_to_read) {
-               if (do_read(bev_ssl, n_to_read) <= 0)
-                       break;
+               r = do_read(bev_ssl, n_to_read);
+               all_result_flags |= r;
 
-               read_data = 1;
+               if (r & (OP_BLOCKED|OP_ERR))
+                       break;
 
                /* Read all pending data.  This won't hit the network
                 * again, and will (most importantly) put us in a state
@@ -800,7 +811,7 @@
                        n_to_read = bytes_to_read(bev_ssl);
        }
 
-       if (read_data == 1) {
+       if (all_result_flags & OP_MADE_PROGRESS) {
                struct bufferevent *bev = &bev_ssl->bev.bev;
                struct evbuffer *input = bev->input;
 
@@ -828,9 +839,7 @@
 
        while (bev_ssl->read_blocked_on_write) {
                r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */
-               if (r <= 0)
-                       break;
-               else {
+               if (r & OP_MADE_PROGRESS) {
                        struct bufferevent *bev = &bev_ssl->bev.bev;
                        struct evbuffer *input = bev->input;
 
@@ -838,6 +847,8 @@
                                _bufferevent_run_readcb(bev);
                        }
                }
+               if (r & (OP_ERR|OP_BLOCKED))
+                       break;
        }
        if (bev_ssl->read_blocked_on_write)
                return;
@@ -855,7 +866,7 @@
                else
                        n_to_write = WRITE_FRAME;
                r = do_write(bev_ssl, n_to_write);
-               if (r <= 0)
+               if (r & (OP_BLOCKED|OP_ERR))
                        break;
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/config.h.in new/libevent-2.0.20-stable/config.h.in
--- old/libevent-2.0.19-stable/config.h.in      2012-05-03 18:28:42.000000000 
+0200
+++ new/libevent-2.0.20-stable/config.h.in      2012-08-23 20:37:14.000000000 
+0200
@@ -331,6 +331,9 @@
 /* Define to 1 if the system has the type `uintptr_t'. */
 #undef HAVE_UINTPTR_T
 
+/* Define to 1 if you have the `umask' function. */
+#undef HAVE_UMASK
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/configure.in new/libevent-2.0.20-stable/configure.in
--- old/libevent-2.0.19-stable/configure.in     2012-05-03 18:26:52.000000000 
+0200
+++ new/libevent-2.0.20-stable/configure.in     2012-08-23 20:36:24.000000000 
+0200
@@ -11,9 +11,9 @@
 
 AC_CONFIG_MACRO_DIR([m4])
 
-AM_INIT_AUTOMAKE(libevent,2.0.19-stable)
+AM_INIT_AUTOMAKE(libevent,2.0.20-stable)
 AM_CONFIG_HEADER(config.h)
-AC_DEFINE(NUMERIC_VERSION, 0x02001300, [Numeric representation of the version])
+AC_DEFINE(NUMERIC_VERSION, 0x02001400, [Numeric representation of the version])
 
 dnl Initialize prefix.
 if test "$prefix" = "NONE"; then
@@ -35,6 +35,7 @@
 dnl Checks for programs.
 AC_PROG_CC
 AM_PROG_CC_C_O
+AC_PROG_SED
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MKDIR_P
@@ -185,6 +186,7 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h stdarg.h inttypes.h stdint.h stddef.h poll.h 
unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h 
sys/select.h sys/devpoll.h port.h netinet/in.h netinet/in6.h sys/socket.h 
sys/uio.h arpa/inet.h sys/eventfd.h sys/mman.h sys/sendfile.h sys/wait.h 
netdb.h])
+AC_CHECK_HEADERS([sys/stat.h])
 AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
@@ -284,6 +286,7 @@
 dnl Checks for library functions.
 AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep])
 AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction 
strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf 
issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl])
+AC_CHECK_FUNCS([umask])
 
 AC_CACHE_CHECK(
     [for getaddrinfo],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/evdns.c new/libevent-2.0.20-stable/evdns.c
--- old/libevent-2.0.19-stable/evdns.c  2012-05-02 22:38:41.000000000 +0200
+++ new/libevent-2.0.20-stable/evdns.c  2012-07-30 22:43:52.000000000 +0200
@@ -2529,6 +2529,7 @@
 {
        struct sockaddr_in sin;
        int res;
+       memset(&sin, 0, sizeof(sin));
        sin.sin_addr.s_addr = address;
        sin.sin_port = htons(53);
        sin.sin_family = AF_INET;
@@ -4213,6 +4214,8 @@
 
        /* Cancel any pending requests, and note which one */
        if (data->ipv4_request.r) {
+               /* XXXX This does nothing if the request's callback is already
+                * running (pending_cb is set). */
                evdns_cancel_request(NULL, data->ipv4_request.r);
                v4_timedout = 1;
                EVDNS_LOCK(data->evdns_base);
@@ -4220,6 +4223,8 @@
                EVDNS_UNLOCK(data->evdns_base);
        }
        if (data->ipv6_request.r) {
+               /* XXXX This does nothing if the request's callback is already
+                * running (pending_cb is set). */
                evdns_cancel_request(NULL, data->ipv6_request.r);
                v6_timedout = 1;
                EVDNS_LOCK(data->evdns_base);
@@ -4243,6 +4248,10 @@
                data->user_cb(e, NULL, data->user_data);
        }
 
+       data->user_cb = NULL; /* prevent double-call if evdns callbacks are
+                              * in-progress. XXXX It would be better if this
+                              * weren't necessary. */
+
        if (!v4_timedout && !v6_timedout) {
                /* should be impossible? XXXX */
                free_getaddrinfo_request(data);
@@ -4313,6 +4322,13 @@
                return;
        }
 
+       if (data->user_cb == NULL) {
+               /* We already answered.  XXXX This shouldn't be needed; see
+                * comments in evdns_getaddrinfo_timeout_cb */
+               free_getaddrinfo_request(data);
+               return;
+       }
+
        if (result == DNS_ERR_NONE) {
                if (count == 0)
                        err = EVUTIL_EAI_NODATA;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/event.c new/libevent-2.0.20-stable/event.c
--- old/libevent-2.0.19-stable/event.c  2012-05-01 23:05:51.000000000 +0200
+++ new/libevent-2.0.20-stable/event.c  2012-08-23 17:35:52.000000000 +0200
@@ -1846,6 +1846,7 @@
 {
        int flags = 0;
 
+       EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
        _event_debug_assert_is_setup(ev);
 
        if (ev->ev_flags & EVLIST_INSERTED)
@@ -1869,6 +1870,8 @@
 #endif
        }
 
+       EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
        return (flags & event);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/evutil_rand.c 
new/libevent-2.0.20-stable/evutil_rand.c
--- old/libevent-2.0.19-stable/evutil_rand.c    2012-02-10 23:17:14.000000000 
+0100
+++ new/libevent-2.0.20-stable/evutil_rand.c    2012-08-02 17:36:53.000000000 
+0200
@@ -58,10 +58,22 @@
 static void
 ev_arc4random_buf(void *buf, size_t n)
 {
-#ifdef _EVENT_HAVE_ARC4RANDOM_BUF
+#if defined(_EVENT_HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__)
        return arc4random_buf(buf, n);
 #else
        unsigned char *b = buf;
+
+#if defined(_EVENT_HAVE_ARC4RANDOM_BUF)
+       /* OSX 10.7 introducd arc4random_buf, so if you build your program
+        * there, you'll get surprised when older versions of OSX fail to run.
+        * To solve this, we can check whether the function pointer is set,
+        * and fall back otherwise.  (OSX does this using some linker
+        * trickery.)
+        */
+       if (arc4random_buf != NULL) {
+               return arc4random_buf(buf, n);
+       }
+#endif
        /* Make sure that we start out with b at a 4-byte alignment; plenty
         * of CPUs care about this for 32-bit access. */
        if (n >= 4 && ((ev_uintptr_t)b) & 3) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/http.c new/libevent-2.0.20-stable/http.c
--- old/libevent-2.0.19-stable/http.c   2012-02-10 23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/http.c   2012-07-26 16:25:01.000000000 +0200
@@ -2685,9 +2685,8 @@
        }
        evbuffer_add(buf, "", 1); /* NUL-terminator. */
        result = mm_malloc(evbuffer_get_length(buf));
-       if (!result)
-               return NULL;
-       evbuffer_remove(buf, result, evbuffer_get_length(buf));
+       if (result)
+               evbuffer_remove(buf, result, evbuffer_get_length(buf));
        evbuffer_free(buf);
 
        return (result);
@@ -3826,9 +3825,12 @@
        if (evutil_make_socket_closeonexec(fd) < 0)
                goto out;
 
-       setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on));
-       if (reuse)
-               evutil_make_listen_socket_reuseable(fd);
+       if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on))<0)
+               goto out;
+       if (reuse) {
+               if (evutil_make_listen_socket_reuseable(fd) < 0)
+                       goto out;
+       }
 
        if (ai != NULL) {
                r = bind(fd, ai->ai_addr, (ev_socklen_t)ai->ai_addrlen);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/include/event2/buffer.h 
new/libevent-2.0.20-stable/include/event2/buffer.h
--- old/libevent-2.0.19-stable/include/event2/buffer.h  2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/include/event2/buffer.h  2012-07-16 
21:32:38.000000000 +0200
@@ -488,7 +488,11 @@
   @param ap a varargs va_list argument array that will be passed to vprintf(3)
   @return The number of bytes added if successful, or -1 if an error occurred.
  */
-int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap);
+int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
+#ifdef __GNUC__
+       __attribute__((format(printf, 2, 0)))
+#endif
+;
 
 
 /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/include/event2/util.h 
new/libevent-2.0.20-stable/include/event2/util.h
--- old/libevent-2.0.19-stable/include/event2/util.h    2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/include/event2/util.h    2012-07-16 
21:32:38.000000000 +0200
@@ -449,7 +449,11 @@
 /** Replacement for vsnprintf to get consistent behavior on platforms for
     which the return value of snprintf does not conform to C99.
  */
-int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap);
+int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+#ifdef __GNUC__
+       __attribute__((format(printf, 3, 0)))
+#endif
+;
 
 /** Replacement for inet_ntop for platforms which lack it. */
 const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/listener.c new/libevent-2.0.20-stable/listener.c
--- old/libevent-2.0.19-stable/listener.c       2012-02-10 23:17:14.000000000 
+0100
+++ new/libevent-2.0.20-stable/listener.c       2012-07-26 16:24:04.000000000 
+0200
@@ -226,9 +226,15 @@
                }
        }
 
-       setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on));
+       if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on))<0) 
{
+               evutil_closesocket(fd);
+               return NULL;
+       }
        if (flags & LEV_OPT_REUSEABLE) {
-               evutil_make_listen_socket_reuseable(fd);
+               if (evutil_make_listen_socket_reuseable(fd) < 0) {
+                       evutil_closesocket(fd);
+                       return NULL;
+               }
        }
 
        if (sa) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/bench_cascade.c 
new/libevent-2.0.20-stable/test/bench_cascade.c
--- old/libevent-2.0.19-stable/test/bench_cascade.c     2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/bench_cascade.c     2012-07-26 
16:36:47.000000000 +0200
@@ -70,8 +70,10 @@
        long idx = (long) arg;
 
        recv(fd, &ch, sizeof(ch), 0);
-       if (idx >= 0)
-               send(idx, "e", 1, 0);
+       if (idx >= 0) {
+               if (send(idx, "e", 1, 0) < 0)
+                       perror("send");
+       }
        fired++;
 }
 
@@ -112,7 +114,8 @@
        fired = 0;
 
        /* kick everything off with a single write */
-       send(pipes[1], "e", 1, 0);
+       if (send(pipes[1], "e", 1, 0) < 0)
+               perror("send");
 
        event_dispatch();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/bench_httpclient.c 
new/libevent-2.0.20-stable/test/bench_httpclient.c
--- old/libevent-2.0.19-stable/test/bench_httpclient.c  2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/bench_httpclient.c  2012-07-26 
16:20:26.000000000 +0200
@@ -115,11 +115,12 @@
 {
        struct linger l;
        int one = 1;
-       setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
+       if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, 
sizeof(one))<0)
+               perror("setsockopt(SO_REUSEADDR)");
        l.l_onoff = 1;
        l.l_linger = 0;
        if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
-               perror("setsockopt");
+               perror("setsockopt(SO_LINGER)");
 }
 
 static int
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress.c 
new/libevent-2.0.20-stable/test/regress.c
--- old/libevent-2.0.19-stable/test/regress.c   2012-05-03 18:14:52.000000000 
+0200
+++ new/libevent-2.0.20-stable/test/regress.c   2012-07-26 16:00:09.000000000 
+0200
@@ -2155,6 +2155,10 @@
            NULL);
        t = evtimer_new(data->base, timeout_cb, NULL);
 
+       tt_assert(r);
+       tt_assert(w);
+       tt_assert(t);
+
        evutil_gettimeofday(&now, NULL);
        event_add(r, NULL);
        event_add(t, &tv);
@@ -2254,7 +2258,8 @@
                event_free(ev1);
        if (ev2)
                event_free(ev2);
-       close(dfd);
+       if (dfd >= 0)
+               close(dfd);
 }
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_buffer.c 
new/libevent-2.0.20-stable/test/regress_buffer.c
--- old/libevent-2.0.19-stable/test/regress_buffer.c    2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_buffer.c    2012-07-26 
15:32:15.000000000 +0200
@@ -1033,6 +1033,8 @@
        unsigned int i;
        struct evbuffer * buf = evbuffer_new();
 
+       tt_assert(buf);
+
        /* make sure evbuffer_find doesn't match past the end of the buffer */
        evbuffer_add(buf, (u_char*)test1, strlen(test1));
        evbuffer_validate(buf);
@@ -1074,6 +1076,8 @@
        struct evbuffer_ptr pos;
        struct evbuffer_iovec v[1];
 
+       tt_assert(buf);
+
        /* create some chains */
        evbuffer_reserve_space(buf, 5000, v, 1);
        v[0].iov_len = 5000;
@@ -1121,6 +1125,9 @@
        struct evbuffer *tmp = evbuffer_new();
        struct evbuffer_ptr pos, end;
 
+       tt_assert(buf);
+       tt_assert(tmp);
+
        /* set up our chains */
        evbuffer_add_printf(tmp, "hello");  /* 5 chars */
        evbuffer_add_buffer(buf, tmp);
@@ -1200,6 +1207,10 @@
        struct evbuffer *buf_out2 = evbuffer_new();
        struct evbuffer_cb_entry *cb1, *cb2;
 
+       tt_assert(buf);
+       tt_assert(buf_out1);
+       tt_assert(buf_out2);
+
        cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
        cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_bufferevent.c 
new/libevent-2.0.20-stable/test/regress_bufferevent.c
--- old/libevent-2.0.19-stable/test/regress_bufferevent.c       2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_bufferevent.c       2012-07-26 
16:02:24.000000000 +0200
@@ -243,6 +243,8 @@
                bev1 = bufferevent_new(pair[0], NULL, wm_writecb, wm_errorcb, 
NULL);
                bev2 = bufferevent_new(pair[1], wm_readcb, NULL, wm_errorcb, 
NULL);
        }
+       tt_assert(bev1);
+       tt_assert(bev2);
        bufferevent_disable(bev1, EV_READ);
        bufferevent_enable(bev2, EV_READ);
 
@@ -267,8 +269,10 @@
        tt_assert(!event_pending(&bev2->ev_write, EV_WRITE, NULL));
 
 end:
-       bufferevent_free(bev1);
-       bufferevent_free(bev2);
+       if (bev1)
+               bufferevent_free(bev1);
+       if (bev2)
+               bufferevent_free(bev2);
 }
 
 static void
@@ -377,8 +381,10 @@
                test_ok = 0;
 
 end:
-       bufferevent_free(bev1);
-       bufferevent_free(bev2);
+       if (bev1)
+               bufferevent_free(bev1);
+       if (bev2)
+               bufferevent_free(bev2);
 
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_dns.c 
new/libevent-2.0.20-stable/test/regress_dns.c
--- old/libevent-2.0.19-stable/test/regress_dns.c       2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_dns.c       2012-07-26 
16:16:24.000000000 +0200
@@ -1048,7 +1048,6 @@
        int expect_err5;
        struct evdns_base *dns=NULL;
        struct evdns_server_port *port=NULL;
-       evutil_socket_t server_fd=-1;
        struct sockaddr_in sin;
        int listener_port=-1;
        ev_uint16_t dns_port=0;
@@ -1066,6 +1065,7 @@
            &n_accept,
            LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC,
            -1, (struct sockaddr *)&sin, sizeof(sin));
+       tt_assert(listener);
        listener_port = regress_get_socket_port(
                evconnlistener_get_fd(listener));
 
@@ -1149,8 +1149,6 @@
 end:
        if (listener)
                evconnlistener_free(listener);
-       if (server_fd>=0)
-               evutil_closesocket(server_fd);
        if (port)
                evdns_close_server_port(port);
        if (dns)
@@ -1211,11 +1209,13 @@
        int n_dns_questions = 0;
 
        struct evdns_base *dns_base = evdns_base_new(data->base, 0);
+       tt_assert(dns_base);
 
        /* for localhost */
        evdns_base_load_hosts(dns_base, NULL);
 
        memset(a_out, 0, sizeof(a_out));
+       memset(&local_outcome, 0, sizeof(local_outcome));
 
        n_gai_results_pending = 10000; /* don't think about exiting yet. */
 
@@ -1704,6 +1704,7 @@
 {
        int ok = 0;
        struct testleak_env_t *env = env_;
+       tt_assert(env);
 #ifdef _EVENT_DISABLE_DEBUG_MODE
        tt_int_op(allocated_chunks, ==, 0);
 #else
@@ -1712,12 +1713,13 @@
 #endif
        ok = 1;
 end:
-       if (env->dns_base)
-               evdns_base_free(env->dns_base, 0);
-       if (env->base)
-               event_base_free(env->base);
-       if (env)
+       if (env) {
+               if (env->dns_base)
+                       evdns_base_free(env->dns_base, 0);
+               if (env->base)
+                       event_base_free(env->base);
                free(env);
+       }
        return ok;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_et.c 
new/libevent-2.0.20-stable/test/regress_et.c
--- old/libevent-2.0.19-stable/test/regress_et.c        2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_et.c        2012-07-26 
16:19:43.000000000 +0200
@@ -104,7 +104,7 @@
 
        called = was_et = 0;
 
-       send(pair[0], test, (int)strlen(test)+1, 0);
+       tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0);
        shutdown(pair[0], SHUT_WR);
 
        /* Initalize the event library */
@@ -173,7 +173,9 @@
 
        /* try mixing edge-triggered and level-triggered to make sure it fails*/
        ev_et = event_new(base, data->pair[0], EV_READ|EV_ET, read_cb, ev_et);
+       tt_assert(ev_et);
        ev_lt = event_new(base, data->pair[0], EV_READ, read_cb, ev_lt);
+       tt_assert(ev_lt);
 
        /* Add edge-triggered, then level-triggered.  Get an error. */
        tt_int_op(0, ==, event_add(ev_et, NULL));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_http.c 
new/libevent-2.0.20-stable/test/regress_http.c
--- old/libevent-2.0.19-stable/test/regress_http.c      2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_http.c      2012-08-23 
16:59:14.000000000 +0200
@@ -892,7 +892,6 @@
        /* We give ownership of the request to the connection */
        if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
                tt_abort_msg("Couldn't make request");
-               exit(1);
        }
 
        event_base_dispatch(data->base);
@@ -1001,7 +1000,6 @@
        /* We give ownership of the request to the connection */
        if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
                tt_abort_msg("Couldn't make request");
-               exit(1);
        }
 
        event_base_dispatch(data->base);
@@ -1844,7 +1842,6 @@
        if (evhttp_make_request(evcon,
            req, EVHTTP_REQ_GET, with_delay ? "/largedelay" : "/test") == -1) {
                tt_abort_msg("couldn't make request");
-               exit(1);
        }
 
        event_base_dispatch(data->base);
@@ -2663,9 +2660,11 @@
                if (header == NULL)
                        goto out;
                /* 13 chars */
-               if (strcmp(header, "d"))
+               if (strcmp(header, "d")) {
+                       free((void*)header);
                        goto out;
-               free((char*)header);
+               }
+               free((void*)header);
 
                if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 
13),
                        "This is funny", 13))
@@ -2691,8 +2690,10 @@
                if (header == NULL)
                        goto out;
                /* 8 chars */
-               if (strcmp(header, "8"))
+               if (strcmp(header, "8")) {
+                       free((void*)header);
                        goto out;
+               }
                free((char *)header);
 
                if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 
8),
@@ -2705,9 +2706,11 @@
                if (header == NULL)
                        goto out;
                /* 0 chars */
-               if (strcmp(header, "0"))
+               if (strcmp(header, "0")) {
+                       free((void*)header);
                        goto out;
-               free((char *)header);
+               }
+               free((void *)header);
 
                test_ok = 2;
 
@@ -3216,26 +3219,30 @@
 http_primitives(void *ptr)
 {
        char *escaped = NULL;
-       struct evhttp *http;
+       struct evhttp *http = NULL;
 
        escaped = evhttp_htmlescape("<script>");
+       tt_assert(escaped);
        tt_str_op(escaped, ==, "&lt;script&gt;");
        free(escaped);
 
        escaped = evhttp_htmlescape("\"\'&");
+       tt_assert(escaped);
        tt_str_op(escaped, ==, "&quot;&#039;&amp;");
 
        http = evhttp_new(NULL);
+       tt_assert(http);
        tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
        tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, -1);
        tt_int_op(evhttp_del_cb(http, "/test"), ==, 0);
        tt_int_op(evhttp_del_cb(http, "/test"), ==, -1);
        tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
-       evhttp_free(http);
 
  end:
        if (escaped)
                free(escaped);
+       if (http)
+               evhttp_free(http);
 }
 
 static void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_listener.c 
new/libevent-2.0.20-stable/test/regress_listener.c
--- old/libevent-2.0.19-stable/test/regress_listener.c  2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_listener.c  2012-07-26 
16:19:17.000000000 +0200
@@ -162,7 +162,7 @@
        }
 
        /* send, so that pair[0] will look 'readable'*/
-       send(data->pair[1], "hello", 5, 0);
+       tt_int_op(send(data->pair[1], "hello", 5, 0), >, 0);
 
        /* Start a listener with a bogus socket. */
        listener = evconnlistener_new(base, acceptcb, &count,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_main.c 
new/libevent-2.0.20-stable/test/regress_main.c
--- old/libevent-2.0.19-stable/test/regress_main.c      2012-05-01 
23:05:51.000000000 +0200
+++ new/libevent-2.0.20-stable/test/regress_main.c      2012-07-26 
15:57:36.000000000 +0200
@@ -58,6 +58,9 @@
 #endif
 
 #include <sys/types.h>
+#ifdef _EVENT_HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
 
 #ifndef WIN32
 #include <sys/socket.h>
@@ -123,6 +126,9 @@
        char tmpfilename[32];
        int fd;
        strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
+#ifdef _EVENT_HAVE_UMASK
+       umask(0077);
+#endif
        fd = mkstemp(tmpfilename);
        if (fd == -1)
                return (-1);
@@ -299,7 +305,7 @@
 legacy_test_setup(const struct testcase_t *testcase)
 {
        struct basic_test_data *data = basic_test_setup(testcase);
-       if (data == (void*)TT_SKIP)
+       if (data == (void*)TT_SKIP || data == NULL)
                return data;
        global_base = data->base;
        pair[0] = data->pair[0];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_rpc.c 
new/libevent-2.0.20-stable/test/regress_rpc.c
--- old/libevent-2.0.19-stable/test/regress_rpc.c       2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_rpc.c       2012-07-26 
15:56:49.000000000 +0200
@@ -113,6 +113,7 @@
                struct evhttp_request* req = EVRPC_REQUEST_HTTP(rpc);
                const char *header = evhttp_find_header(
                        req->input_headers, "X-Hook");
+               assert(header);
                assert(strcmp(header, "input") == 0);
        }
 
@@ -332,6 +333,7 @@
                struct evhttp_request *req = status->http_req;
                const char *header = evhttp_find_header(
                        req->input_headers, "X-Pool-Hook");
+               assert(header);
                assert(strcmp(header, "ran") == 0);
        }
 
@@ -734,6 +736,9 @@
        int i;
 
        msg = msg_new();
+
+       tt_assert(msg);
+
        EVTAG_ASSIGN(msg, from_name, "niels");
        EVTAG_ASSIGN(msg, to_name, "phoenix");
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_ssl.c 
new/libevent-2.0.20-stable/test/regress_ssl.c
--- old/libevent-2.0.19-stable/test/regress_ssl.c       2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_ssl.c       2012-07-26 
16:25:31.000000000 +0200
@@ -108,7 +108,8 @@
 
        name = X509_NAME_new();
        tt_assert(name);
-       tt_assert(NID_undef != (nid = OBJ_txt2nid("commonName")));
+       nid = OBJ_txt2nid("commonName");
+       tt_assert(NID_undef != nid);
        tt_assert(0 != X509_NAME_add_entry_by_NID(
                    name, nid, MBSTRING_ASC, (unsigned char*)"example.com",
                    -1, -1, 0));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/regress_testutils.c 
new/libevent-2.0.20-stable/test/regress_testutils.c
--- old/libevent-2.0.19-stable/test/regress_testutils.c 2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/regress_testutils.c 2012-07-26 
16:18:49.000000000 +0200
@@ -102,7 +102,7 @@
        struct sockaddr_in my_addr;
 
        sock = socket(AF_INET, SOCK_DGRAM, 0);
-       if (sock <= 0) {
+       if (sock < 0) {
                tt_abort_perror("socket");
        }
 
@@ -113,6 +113,7 @@
        my_addr.sin_port = htons(*portnum);
        my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
        if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
+               evutil_closesocket(sock);
                tt_abort_perror("bind");
        }
        port = evdns_add_server_port_with_base(base, sock, 0, cb, arg);
@@ -178,12 +179,16 @@
                return;
        } else if (!strcmp(tab->anstype, "A")) {
                struct in_addr in;
-               evutil_inet_pton(AF_INET, tab->ans, &in);
+               if (!evutil_inet_pton(AF_INET, tab->ans, &in)) {
+                       TT_DIE(("Bad A value %s in table", tab->ans));
+               }
                evdns_server_request_add_a_reply(req, question, 1, &in.s_addr,
                    100);
        } else if (!strcmp(tab->anstype, "AAAA")) {
                struct in6_addr in6;
-               evutil_inet_pton(AF_INET6, tab->ans, &in6);
+               if (!evutil_inet_pton(AF_INET6, tab->ans, &in6)) {
+                       TT_DIE(("Bad AAAA value %s in table", tab->ans));
+               }
                evdns_server_request_add_aaaa_reply(req,
                    question, 1, &in6.s6_addr, 100);
        } else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/test-changelist.c 
new/libevent-2.0.20-stable/test/test-changelist.c
--- old/libevent-2.0.19-stable/test/test-changelist.c   2012-02-10 
23:26:42.000000000 +0100
+++ new/libevent-2.0.20-stable/test/test-changelist.c   2012-06-06 
23:06:23.000000000 +0200
@@ -202,6 +202,10 @@
 
        event_base_dispatch(base);
 
+       event_free(ev);
+       event_free(timeout);
+       event_base_free(base);
+
        get_cpu_usage(&timer, &secPassed, &secUsed, &usage);
 
        /* attempt to calculate our cpu usage over the test should be
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/test-eof.c 
new/libevent-2.0.20-stable/test/test-eof.c
--- old/libevent-2.0.19-stable/test/test-eof.c  2012-02-10 23:26:20.000000000 
+0100
+++ new/libevent-2.0.20-stable/test/test-eof.c  2012-07-26 16:17:21.000000000 
+0200
@@ -106,7 +106,8 @@
                return (1);
 
 
-       send(pair[0], test, (int)strlen(test)+1, 0);
+       if (send(pair[0], test, (int)strlen(test)+1, 0) < 0)
+               return (1);
        shutdown(pair[0], SHUT_WR);
 
        /* Initalize the event library */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/test/test-ratelim.c 
new/libevent-2.0.20-stable/test/test-ratelim.c
--- old/libevent-2.0.19-stable/test/test-ratelim.c      2012-02-10 
23:17:14.000000000 +0100
+++ new/libevent-2.0.20-stable/test/test-ratelim.c      2012-06-06 
23:06:23.000000000 +0200
@@ -210,6 +210,7 @@
 #endif
 
        base = event_base_new_with_config(base_cfg);
+       event_config_free(base_cfg);
 
        listener = evconnlistener_new_bind(base, echo_listenercb, base,
            LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE, -1,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/libevent-2.0.19-stable/win32select.c 
new/libevent-2.0.20-stable/win32select.c
--- old/libevent-2.0.19-stable/win32select.c    2012-02-10 23:17:14.000000000 
+0100
+++ new/libevent-2.0.20-stable/win32select.c    2012-07-16 21:34:02.000000000 
+0200
@@ -298,7 +298,7 @@
            win32op->readset_out->fd_count : win32op->writeset_out->fd_count;
 
        if (!fd_count) {
-               long msec = evutil_tv_to_msec(tv);
+               long msec = tv ? evutil_tv_to_msec(tv) : LONG_MAX;
                /* Sleep's DWORD argument is unsigned long */
                if (msec < 0)
                        msec = LONG_MAX;

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to