You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
url::parse_query() seems to parse query values beyond the data passed into the function's string_view argument. I see this using Boost 1.82.
Example reproduction:
#include <boost/url/parse.hpp>
#include <boost/url/parse_query.hpp>
#include <iostream>
#include <string>
#include <string_view>
int main() {
auto data = std::string("abc=def&ghi=jkl&mno=pqr");
auto view = std::string_view( data.data(), data.size() - 2 );
auto fp = boost::urls::parse_query( view );
for ( auto &&p : fp.value() ) {
std::cout << "(" << p.key << ")(" << p.value << ")\n";
}
}
// Expected output:
// (abc)(def)
// (ghi)(jkl)
// (mno)(p)
// Actual output:
// (abc)(def)
// (ghi)(jkl)
// (mno)(pqr)
Notice that although the string_view was shortened by 2 characters from the full string before it was passed into parse_query(), the two characters are still included in the result of the parse.
The text was updated successfully, but these errors were encountered:
url::parse_query() seems to parse query values beyond the data passed into the function's string_view argument. I see this using Boost 1.82.
Example reproduction:
Notice that although the string_view was shortened by 2 characters from the full string before it was passed into
parse_query()
, the two characters are still included in the result of the parse.The text was updated successfully, but these errors were encountered: