summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-support/curl/curl/CVE-2017-1000257.patch39
-rw-r--r--recipes-support/curl/curl_%.bbappend1
2 files changed, 40 insertions, 0 deletions
diff --git a/recipes-support/curl/curl/CVE-2017-1000257.patch b/recipes-support/curl/curl/CVE-2017-1000257.patch
new file mode 100644
index 0000000..de0dc3a
--- /dev/null
+++ b/recipes-support/curl/curl/CVE-2017-1000257.patch
@@ -0,0 +1,39 @@
1From 13c9a9ded3ae744a1e11cbc14e9146d9fa427040 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Sat, 7 Oct 2017 00:11:31 +0200
4Subject: [PATCH] imap: if a FETCH response has no size, don't call write
5 callback
6
7CVE: CVE-2017-1000257
8Upstream-Status: Backport [https://curl.haxx.se/CVE-2017-1000257.patch]
9
10Reported-by: Brian Carpenter and 0xd34db347
11Also detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3586
12Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
13---
14 lib/imap.c | 5 +++++
15 1 file changed, 5 insertions(+)
16
17diff --git a/lib/imap.c b/lib/imap.c
18index 954d18f37..baa31a2f8 100644
19--- a/lib/imap.c
20+++ b/lib/imap.c
21@@ -1124,10 +1124,15 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
22
23 if(chunk > (size_t)size)
24 /* The conversion from curl_off_t to size_t is always fine here */
25 chunk = (size_t)size;
26
27+ if(!chunk) {
28+ /* no size, we're done with the data */
29+ state(conn, IMAP_STOP);
30+ return CURLE_OK;
31+ }
32 result = Curl_client_write(conn, CLIENTWRITE_BODY, pp->cache, chunk);
33 if(result)
34 return result;
35
36 data->req.bytecount += chunk;
37--
382.15.0.rc1
39
diff --git a/recipes-support/curl/curl_%.bbappend b/recipes-support/curl/curl_%.bbappend
index 82db0f7..bc75100 100644
--- a/recipes-support/curl/curl_%.bbappend
+++ b/recipes-support/curl/curl_%.bbappend
@@ -5,4 +5,5 @@ SRC_URI += "file://CVE-2017-7407.patch \
5 file://CVE-2017-7468.patch \ 5 file://CVE-2017-7468.patch \
6 file://CVE-2017-9502.patch \ 6 file://CVE-2017-9502.patch \
7 file://CVE-2017-1000254.patch \ 7 file://CVE-2017-1000254.patch \
8 file://CVE-2017-1000257.patch \
8 " 9 "