Skip to content

Commit

Permalink
Merge pull request qbittorrent#13042 from FranciscoPombal/fix_request…
Browse files Browse the repository at this point in the history
…_parser

Fix truncation when parsing HTTP request query
  • Loading branch information
glassez authored and IceCodeNew committed Aug 28, 2020
1 parent 48bbff4 commit 8a0a999
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# defines
add_definitions(-DQT_DEPRECATED_WARNINGS)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_STRICT_ITERATORS)

Expand Down
2 changes: 1 addition & 1 deletion src/base/http/requestparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ include(../version.pri)
# Qt defines
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QT_NO_CAST_TO_ASCII
DEFINES += QT_NO_CAST_FROM_BYTEARRAY
DEFINES += QT_USE_QSTRINGBUILDER
DEFINES += QT_STRICT_ITERATORS

Expand Down

0 comments on commit 8a0a999

Please sign in to comment.