From cef538fdf33d03f5913c9794589bedd3ece913d9 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 18 Jun 2019 00:15:51 -0700 Subject: [PATCH] modules/client/publicrooms: Fix url decoding of query string arguments. --- modules/client/publicrooms.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/client/publicrooms.cc b/modules/client/publicrooms.cc index 2d60218d5..8733212de 100644 --- a/modules/client/publicrooms.cc +++ b/modules/client/publicrooms.cc @@ -52,11 +52,12 @@ resource::response get__publicrooms(client &client, const resource::request &request) { + char since_buf[256]; const string_view &since { request.has("since")? unquote(request["since"]): - request.query["since"] + url::decode(since_buf, request.query["since"]) }; if(since && !valid(m::id::ROOM, since)) @@ -65,9 +66,10 @@ get__publicrooms(client &client, "Invalid since token for this server." }; + char server_buf[256]; const auto &server { - request.query["server"] + url::decode(server_buf, request.query["server"]) }; const json::object &filter