mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-29 19:18:42 -07:00
Fix truncation when parsing HTTP request query
Closes #13029. Fixes an issue with truncation of a QByteArray at the first '\0' byte when parsing HTTP request query strings. Previously, the operands of the ternary expression were of different types. Most likely this was leading to a conversion of the result to some kind of '\0'-terminated string type somewhere along the way, in turn causing its truncation at the first '\0' byte once converted back to QByteArray. For some reason this bug was only present on Windows (MSVC).
This commit is contained in:
parent
9dfeeb9e81
commit
0fa7fca31e
1 changed files with 1 additions and 1 deletions
|
@ -202,7 +202,7 @@ bool RequestParser::parseRequestLine(const QString &line)
|
|||
const QByteArray valueComponent = midView(param, (eqCharPos + 1));
|
||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' '));
|
||||
const QByteArray paramValue = valueComponent.isNull()
|
||||
? ""
|
||||
? QByteArray("")
|
||||
: QByteArray::fromPercentEncoding(valueComponent).replace('+', ' ');
|
||||
|
||||
m_request.query[paramName] = paramValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue