Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/filter/ElemHideBase.cpp

Issue 29616589: Noissue - Ensure ElemHideBase::GetSelector() doesn't misuse a read only string (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Nov. 23, 2017, 4:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/filter/ElemHideBase.cpp
===================================================================
--- a/compiled/filter/ElemHideBase.cpp
+++ b/compiled/filter/ElemHideBase.cpp
@@ -154,17 +154,17 @@
}
return result;
}
}
OwnedString ElemHideBase::GetSelector() const
{
- DependentString selector = mData.GetSelector(mText);
+ const DependentString selector = mData.GetSelector(mText);
String::size_type replacementCount = 0;
for (String::size_type i = 0; i < selector.length(); i++)
if (selector[i] == '}' || selector[i] == '{')
replacementCount++;
if (replacementCount)
return EscapeCurlies(replacementCount, selector);
return OwnedString(selector);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld