summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2020-02-06 16:24:53 +0000
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-02-07 15:35:57 +0100
commiteb8307c8adc986ad9ec81a17ab3cff07fc481c6f (patch)
treeff3d6e7a87b5d2d72eda768b511f16bce4663258
parent0c48789be7a54ebe146de6595bb32b534618c5d7 (diff)
neon: escape broken SharePoint 2016 URIs
SharePoint returns broken URIs in its href replies, which aren't correctly URI encoded, but still "valid" URIs w.r.t. general and UTF8 encoding, e.g. http://<host>/Shared%20Documents/├╝mlaut.docx As a workaround, this allows all invalid / other bytes (except '\0') in the path of the URI in ne_uri_parse. Change-Id: I70e7d323837469d7ced429a42c009972f4fb0ebc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88120 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins (cherry picked from commit 069aa870aadb9f9069e8715c8be30394410f0288) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88200 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--external/neon/UnpackedTarball_neon.mk1
-rw-r--r--external/neon/neon_uri_parse_allow_others.patch22
2 files changed, 23 insertions, 0 deletions
diff --git a/external/neon/UnpackedTarball_neon.mk b/external/neon/UnpackedTarball_neon.mk
index 74ac2eb38c97..725e1916cd28 100644
--- a/external/neon/UnpackedTarball_neon.mk
+++ b/external/neon/UnpackedTarball_neon.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,neon,\
external/neon/neon_fix_lock_token_on_if.patch \
external/neon/neon_fix_lock_timeout_windows.patch \
external/neon/neon_fix_sspi_session_timeout.patch \
+ external/neon/neon_uri_parse_allow_others.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/neon/neon_uri_parse_allow_others.patch b/external/neon/neon_uri_parse_allow_others.patch
new file mode 100644
index 000000000000..9de2cf6b9ae7
--- /dev/null
+++ b/external/neon/neon_uri_parse_allow_others.patch
@@ -0,0 +1,22 @@
+diff -ur src/ne_uri.c
+--- src/ne_uri.c 2020-02-07 10:49:58.764417840 +0000
++++ src/ne_uri.c 2020-02-07 10:51:33.675627141 +0000
+@@ -87,7 +87,8 @@
+ #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
+ /* invented: segchar = pchar / "/" */
+ /* (TKR) WS added */
+-#define URI_SEGCHAR (URI_PCHAR | FS | WS)
++/* also allow OT characters to parse SharePoint 2016 href URIs with unescaped UTF8 */
++#define URI_SEGCHAR (URI_PCHAR | FS | WS | OT)
+ /* query = *( pchar / "/" / "?" ) */
+ #define URI_QUERY (URI_PCHAR | FS | QU)
+ /* fragment == query */
+@@ -237,7 +238,7 @@
+
+ p = s;
+
+- while (uri_lookup(*p) & URI_SEGCHAR)
++ while (uri_lookup(*p) & URI_SEGCHAR && *p != '\0')
+ p++;
+
+ /* => p = [ "?" query ] [ "#" fragment ] */