summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-09 17:38:14 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-11 10:48:42 +0200
commit1422b89e076fec84cab9a732648833ce03f09caa (patch)
treef50f2d35a7ebcb7b6ea2947b68d5443eca3f4431
parent0e1a0b99565cc6b9cf63802e5a3ae26de67bdc5b (diff)
desktop,extensions: updater: only allow redirects to HTTP/HTTPS
Configure curl to prevent redirects to other protocols. Change-Id: Ied73b3d9a062ea6e0a1d594f4c12162dffd6c4a7 (cherry picked from commit bd60bbfbdfbeb2687297e4512ddbea62a394ae67) Reviewed-on: https://gerrit.libreoffice.org/40940 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 3dceaeee4ff511f4c4b67846bdc5b87fda4a3633)
-rw-r--r--extensions/source/update/check/download.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index 43320b51fbdc..3a822dd81c87 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -238,6 +238,8 @@ bool curl_run(const OUString& rURL, OutData& out, const OString& aProxyHost, sal
// enable redirection
curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
+ // only allow redirect to http:// and https://
+ curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
// write function
curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out);