diff options
author | Mark H Weaver <mhw@netris.org> | 2017-03-18 02:29:12 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2017-03-19 15:54:58 -0400 |
commit | 512fc6db7bb900a892810d4b3c8b0e712b8e2379 (patch) | |
tree | 5d44de567c16b9138d1cce2760e5216c379fc051 | |
parent | 26e34e1e1288d657e92372efb6edc95c0e299247 (diff) | |
download | guix-512fc6db7bb900a892810d4b3c8b0e712b8e2379.tar.gz |
gnu: libevent@2.0: Add fix from upstream.
This fix was cherry-picked by Mozilla from upstream libevent-2.1 to its bundled copy of libevent-2.0.21 in mozilla-esr45. * gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/libevent.scm (libevent-2.0)[source][patches]: Add it.
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/libevent.scm | 28 | ||||
-rw-r--r-- | gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch | 38 |
3 files changed, 54 insertions, 13 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 48c134ba6e..885c1137a5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -677,6 +677,7 @@ dist_patch_DATA = \ %D%/packages/patches/libdrm-symbol-check.patch \ %D%/packages/patches/libepoxy-gl-null-checks.patch \ %D%/packages/patches/libevent-dns-tests.patch \ + %D%/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch \ %D%/packages/patches/libevent-2.0-evdns-fix-remote-stack-overread.patch \ %D%/packages/patches/libevent-2.0-evdns-fix-searching-empty-hostnames.patch \ %D%/packages/patches/libevent-2.0-evutil-fix-buffer-overflow.patch \ diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm index dd5f7c4067..6e2ce8f257 100644 --- a/gnu/packages/libevent.scm +++ b/gnu/packages/libevent.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> -;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr> ;;; Copyright © 2016 David Thompson <davet@gnu.org> ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> @@ -74,18 +74,20 @@ loop.") (inherit libevent) (version "2.0.22") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/libevent/libevent/releases/download/release-" - version "-stable/libevent-" version "-stable.tar.gz")) - (sha256 - (base32 - "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki")) - (patches (search-patches - "libevent-dns-tests.patch" - "libevent-2.0-evdns-fix-remote-stack-overread.patch" - "libevent-2.0-evutil-fix-buffer-overflow.patch" - "libevent-2.0-evdns-fix-searching-empty-hostnames.patch")))))) + (method url-fetch) + (uri (string-append + "https://github.com/libevent/libevent/releases/download/release-" + version "-stable/libevent-" version "-stable.tar.gz")) + (sha256 + (base32 + "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki")) + (patches + (search-patches + "libevent-dns-tests.patch" + "libevent-2.0-evdns-fix-remote-stack-overread.patch" + "libevent-2.0-evutil-fix-buffer-overflow.patch" + "libevent-2.0-evdns-fix-searching-empty-hostnames.patch" + "libevent-2.0-evbuffer-add-use-last-with-datap.patch")))))) (define-public libev (package diff --git a/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch b/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch new file mode 100644 index 0000000000..0253700bf6 --- /dev/null +++ b/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch @@ -0,0 +1,38 @@ +From a8769ef12d7e223e33fc47bed03fba2bfa2f3536 Mon Sep 17 00:00:00 2001 +From: Marcus Sundberg <marcus@marcussundberg.com> +Date: Sat, 26 Mar 2016 20:11:43 +0100 +Subject: [PATCH] evbuffer_add: Use last_with_datap if set, not last. + +evbuffer_add() would always put data in the last chain, even if there +was available space in a previous chain, and in doing so it also +failed to update last_with_datap, causing subsequent calls to other +functions that do look at last_with_datap to add data in the middle +of the evbuffer instead of at the end. + +Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and +evbuffer/add3 tests, and also prevents wasting space available in the +chain pointed to by last_with_datap. +--- + buffer.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/buffer.c b/buffer.c +index 7cca0e8a..f378b731 100644 +--- a/buffer.c ++++ b/buffer.c +@@ -1732,7 +1732,11 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) + goto done; + } + +- chain = buf->last; ++ if (*buf->last_with_datap == NULL) { ++ chain = buf->last; ++ } else { ++ chain = *buf->last_with_datap; ++ } + + /* If there are no chains allocated for this buffer, allocate one + * big enough to hold all the data. */ +-- +2.12.0 + |