guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: address@hidden: Add fix from upstream.


From: Mark H. Weaver
Subject: 01/02: gnu: address@hidden: Add fix from upstream.
Date: Sun, 19 Mar 2017 15:56:59 -0400 (EDT)

mhw pushed a commit to branch master
in repository guix.

commit 512fc6db7bb900a892810d4b3c8b0e712b8e2379
Author: Mark H Weaver <address@hidden>
Date:   Sat Mar 18 02:29:12 2017 -0400

    gnu: address@hidden: 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.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/libevent.scm                          | 28 ++++++++--------
 ...vent-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 48c134b..885c113 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 dd5f7c4..6e2ce8f 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 <address@hidden>
-;;; Copyright © 2015 Mark H Weaver <address@hidden>
+;;; Copyright © 2015, 2017 Mark H Weaver <address@hidden>
 ;;; Copyright © 2015 Eric Dvorsak <address@hidden>
 ;;; Copyright © 2016 David Thompson <address@hidden>
 ;;; Copyright © 2017 Marius Bakke <address@hidden>
@@ -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 0000000..0253700
--- /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 <address@hidden>
+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
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]