From: Kees Monshouwer Date: Wed, 20 Nov 2013 18:48:19 +0000 (+0100) Subject: fix parameter parsing in yahttp X-Git-Tag: rec-3.6.0-rc1~335^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc586d61e4a5c4be47c04ed24a8c252ff143de04;p=pdns fix parameter parsing in yahttp --- diff --git a/pdns/ext/yahttp/yahttp/utility.hpp b/pdns/ext/yahttp/yahttp/utility.hpp index 65413b839..ba9ed9461 100644 --- a/pdns/ext/yahttp/yahttp/utility.hpp +++ b/pdns/ext/yahttp/yahttp/utility.hpp @@ -155,7 +155,7 @@ namespace YaHTTP { if (nextpos == std::string::npos) { value = parameters.substr(delim+1); } else { - value = parameters.substr(delim+1, nextpos-delim); + value = parameters.substr(delim+1, nextpos-delim-1); } } if (key.empty()) { @@ -165,8 +165,12 @@ namespace YaHTTP { key = decodeURL(key); value = decodeURL(value); parameter_map[key] = value; + if (nextpos == std::string::npos) { + // no more parameters left + break; + } - pos = nextpos; + pos = nextpos+1; } return parameter_map; };