summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2013-04-05 23:39:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-05 23:05:34 +0100
commitf5835878166d0b302c85a29ef1944e6b72e61260 (patch)
tree6c60c56a59971828d7c6cd402a0c57c7bcffdb25 /meta
parent6eeb94247049c6697da8e9339280bc4efe14db72 (diff)
downloadpoky-f5835878166d0b302c85a29ef1944e6b72e61260.tar.gz
curl: backport patch to fix segfaults
* e.g. ecore, efreet segfault a lot without this patch (From OE-Core rev: b93011d3e719c46089ccdb39c60d3a9e9cfa5a14) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/curl/curl/0001-Fix-NULL-pointer-reference-when-closing-an-unused-mu.patch170
-rw-r--r--meta/recipes-support/curl/curl_7.29.0.bb3
2 files changed, 172 insertions, 1 deletions
diff --git a/meta/recipes-support/curl/curl/0001-Fix-NULL-pointer-reference-when-closing-an-unused-mu.patch b/meta/recipes-support/curl/curl/0001-Fix-NULL-pointer-reference-when-closing-an-unused-mu.patch
new file mode 100644
index 0000000000..914024e126
--- /dev/null
+++ b/meta/recipes-support/curl/curl/0001-Fix-NULL-pointer-reference-when-closing-an-unused-mu.patch
@@ -0,0 +1,170 @@
1From 5887472e49ce6c14590760f0650775653045abb5 Mon Sep 17 00:00:00 2001
2From: Linus Nielsen Feltzing <linus@haxx.se>
3Date: Sun, 10 Feb 2013 22:57:58 +0100
4Subject: [PATCH] Fix NULL pointer reference when closing an unused multi
5 handle.
6
7Upstream-Status: Backport
8https://github.com/bagder/curl/commit/da3fc1ee91de656a30f3a12de394bcba55119872
9
10Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
11
12---
13 lib/multi.c | 8 +++++---
14 tests/data/Makefile.am | 2 +-
15 tests/data/test1508 | 31 +++++++++++++++++++++++++++++
16 tests/libtest/Makefile.inc | 6 +++++-
17 tests/libtest/lib1508.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
18 5 files changed, 91 insertions(+), 5 deletions(-)
19 create mode 100644 tests/data/test1508
20 create mode 100644 tests/libtest/lib1508.c
21
22diff --git a/lib/multi.c b/lib/multi.c
23index fa0afb9..706df23 100644
24--- a/lib/multi.c
25+++ b/lib/multi.c
26@@ -1773,10 +1773,12 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
27 /* Close all the connections in the connection cache */
28 close_all_connections(multi);
29
30- multi->closure_handle->dns.hostcache = multi->hostcache;
31- Curl_hostcache_clean(multi->closure_handle);
32+ if(multi->closure_handle) {
33+ multi->closure_handle->dns.hostcache = multi->hostcache;
34+ Curl_hostcache_clean(multi->closure_handle);
35
36- Curl_close(multi->closure_handle);
37+ Curl_close(multi->closure_handle);
38+ }
39 multi->closure_handle = NULL;
40
41 Curl_hash_destroy(multi->sockhash);
42diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
43index d82534d..9f569a3 100644
44--- a/tests/data/Makefile.am
45+++ b/tests/data/Makefile.am
46@@ -93,7 +93,7 @@ test1379 test1380 test1381 test1382 test1383 test1384 test1385 test1386 \
47 test1387 test1388 test1389 test1390 test1391 test1392 test1393 \
48 test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \
49 test1408 test1409 test1410 test1411 test1412 test1413 \
50-test1500 test1501 test1502 test1503 test1504 test1505 test1506 \
51+test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1508 \
52 test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \
53 test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \
54 test2016 test2017 test2018 test2019 test2020 test2021 test2022 \
55diff --git a/tests/data/test1508 b/tests/data/test1508
56new file mode 100644
57index 0000000..f8607e5
58--- /dev/null
59+++ b/tests/data/test1508
60@@ -0,0 +1,31 @@
61+<testcase>
62+<info>
63+<keywords>
64+HTTP
65+multi
66+</keywords>
67+</info>
68+
69+# Client-side
70+<client>
71+<server>
72+none
73+</server>
74+<tool>
75+lib1508
76+</tool>
77+ <name>
78+Close a multi handle without using it
79+ </name>
80+ <command>
81+http://%HOSTIP:%HTTPPORT/path/1508
82+</command>
83+</client>
84+
85+# Verify data after the test has been "shot"
86+<verify>
87+<file name="log/stdout1508" mode="text">
88+We are done
89+</file>
90+</verify>
91+</testcase>
92diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
93index 82c265d..8bf2be4 100644
94--- a/tests/libtest/Makefile.inc
95+++ b/tests/libtest/Makefile.inc
96@@ -23,7 +23,7 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect \
97 lib582 lib583 lib585 lib586 lib587 \
98 lib590 lib591 lib597 lib598 lib599 \
99 \
100- lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506
101+ lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1508
102
103 chkhostname_SOURCES = chkhostname.c ../../lib/curl_gethostname.c
104 chkhostname_LDADD = @CURL_NETWORK_LIBS@
105@@ -312,3 +312,7 @@ lib1505_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1505
106 lib1506_SOURCES = lib1506.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
107 lib1506_LDADD = $(TESTUTIL_LIBS)
108 lib1506_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1506
109+
110+lib1508_SOURCES = lib1508.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
111+lib1508_LDADD = $(TESTUTIL_LIBS)
112+lib1508_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1508
113diff --git a/tests/libtest/lib1508.c b/tests/libtest/lib1508.c
114new file mode 100644
115index 0000000..72f26d1
116--- /dev/null
117+++ b/tests/libtest/lib1508.c
118@@ -0,0 +1,49 @@
119+/***************************************************************************
120+ * _ _ ____ _
121+ * Project ___| | | | _ \| |
122+ * / __| | | | |_) | |
123+ * | (__| |_| | _ <| |___
124+ * \___|\___/|_| \_\_____|
125+ *
126+ * Copyright (C) 2013, Linus Nielsen Feltzing <linus@haxx.se>
127+ *
128+ * This software is licensed as described in the file COPYING, which
129+ * you should have received as part of this distribution. The terms
130+ * are also available at http://curl.haxx.se/docs/copyright.html.
131+ *
132+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
133+ * copies of the Software, and permit persons to whom the Software is
134+ * furnished to do so, under the terms of the COPYING file.
135+ *
136+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
137+ * KIND, either express or implied.
138+ *
139+ ***************************************************************************/
140+#include "test.h"
141+
142+#include "testutil.h"
143+#include "warnless.h"
144+#include "memdebug.h"
145+
146+int test(char *URL)
147+{
148+ int res = 0;
149+ CURLM *m = NULL;
150+
151+ (void)URL;
152+
153+ global_init(CURL_GLOBAL_ALL);
154+
155+ multi_init(m);
156+
157+test_cleanup:
158+
159+ /* proper cleanup sequence - type PB */
160+
161+ curl_multi_cleanup(m);
162+ curl_global_cleanup();
163+
164+ printf("We are done\n");
165+
166+ return res;
167+}
168--
1691.8.1.5
170
diff --git a/meta/recipes-support/curl/curl_7.29.0.bb b/meta/recipes-support/curl/curl_7.29.0.bb
index 01ffeca56f..3669cb8524 100644
--- a/meta/recipes-support/curl/curl_7.29.0.bb
+++ b/meta/recipes-support/curl/curl_7.29.0.bb
@@ -8,10 +8,11 @@ LIC_FILES_CHKSUM = "file://COPYING;beginline=7;md5=3a34942f4ae3fbf1a303160714e66
8DEPENDS = "zlib gnutls" 8DEPENDS = "zlib gnutls"
9DEPENDS_class-native = "zlib-native openssl-native" 9DEPENDS_class-native = "zlib-native openssl-native"
10DEPENDS_class-nativesdk = "nativesdk-zlib" 10DEPENDS_class-nativesdk = "nativesdk-zlib"
11PR = "r0" 11PR = "r1"
12 12
13SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ 13SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
14 file://pkgconfig_fix.patch \ 14 file://pkgconfig_fix.patch \
15 file://0001-Fix-NULL-pointer-reference-when-closing-an-unused-mu.patch \
15" 16"
16 17
17# curl likes to set -g0 in CFLAGS, so we stop it 18# curl likes to set -g0 in CFLAGS, so we stop it