Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit600daff

Browse files
committed
Fix unsafe usage of boost::as_literal, caught by memory sanitiser
1 parent4be4eae commit600daff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎boost/network/uri/uri.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ inline bool operator==(const uri::string_type &lhs, const uri &rhs) {
310310
}
311311

312312
inlinebooloperator==(const uri &lhs,const uri::value_type *rhs) {
313-
returnboost::equal(lhs,boost::as_literal(rhs));
313+
auto rlen =strlen(rhs);
314+
auto llen =std::distance(lhs.begin(), lhs.end());
315+
if (rlen !=std::abs(llen))returnfalse;
316+
returnboost::equal(lhs,boost::make_iterator_range(rhs, rhs + rlen));
314317
}
315318

316319
inlinebooloperator==(const uri::value_type *lhs,const uri &rhs) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp