aboutsummaryrefslogtreecommitdiffstats
path: root/main/curl/CVE-2016-8619.patch
diff options
context:
space:
mode:
authorSergey Lukin <sergej.lukin@gmail.com>2016-12-09 08:23:32 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-12-26 09:46:12 +0000
commitba3dc3d210189d8b88c35c3b6850f54f8041f3fa (patch)
treeb1ecf74c7594105573debcf6ccfd2f67522c03c6 /main/curl/CVE-2016-8619.patch
parentf7fb6eb9c7b2bdc8ac41b605df86bb2fa114e89a (diff)
downloadaports-ba3dc3d210189d8b88c35c3b6850f54f8041f3fa.tar.gz
aports-ba3dc3d210189d8b88c35c3b6850f54f8041f3fa.tar.bz2
aports-ba3dc3d210189d8b88c35c3b6850f54f8041f3fa.tar.xz
main/curl: security upgrade - fixes #64373.1-stable
Diffstat (limited to 'main/curl/CVE-2016-8619.patch')
-rw-r--r--main/curl/CVE-2016-8619.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/curl/CVE-2016-8619.patch b/main/curl/CVE-2016-8619.patch
new file mode 100644
index 0000000000..8470b359bb
--- /dev/null
+++ b/main/curl/CVE-2016-8619.patch
@@ -0,0 +1,50 @@
+From 91239f7040b1f026d4d15765e7e3f58e92e93761 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Wed, 28 Sep 2016 12:56:02 +0200
+Subject: [PATCH] krb5: avoid realloc(0)
+
+If the requested size is zero, bail out with error instead of doing a
+realloc() that would cause a double-free: realloc(0) acts as a free()
+and then there's a second free in the cleanup path.
+
+CVE-2016-8619
+
+Bug: https://curl.haxx.se/docs/adv_20161102E.html
+Reported-by: Cure53
+---
+ lib/security.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/security.c b/lib/security.c
+index a268d4a..4cef8f8 100644
+--- a/lib/security.c
++++ b/lib/security.c
+@@ -190,19 +190,22 @@ socket_write(struct connectdata *conn, curl_socket_t fd, const void *to,
+ static CURLcode read_data(struct connectdata *conn,
+ curl_socket_t fd,
+ struct krb5buffer *buf)
+ {
+ int len;
+- void* tmp;
++ void *tmp = NULL;
+ CURLcode result;
+
+ result = socket_read(fd, &len, sizeof(len));
+ if(result)
+ return result;
+
+- len = ntohl(len);
+- tmp = realloc(buf->data, len);
++ if(len) {
++ /* only realloc if there was a length */
++ len = ntohl(len);
++ tmp = realloc(buf->data, len);
++ }
+ if(tmp == NULL)
+ return CURLE_OUT_OF_MEMORY;
+
+ buf->data = tmp;
+ result = socket_read(fd, buf->data, len);
+--
+2.9.3
+