[webkit-reviews] review granted: [Bug 57552] Find client not told when WKPageCountStringMatches exceeds maximum : [Attachment 87733] Take two, featuring non-degenerate ChangeLog entry.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 31 08:53:46 PDT 2011


Adam Roben (:aroben) <aroben at apple.com> has granted John Sullivan
<sullivan at apple.com>'s request for review:
Bug 57552: Find client not told when WKPageCountStringMatches exceeds maximum
https://bugs.webkit.org/show_bug.cgi?id=57552

Attachment 87733: Take two, featuring non-degenerate ChangeLog entry.
https://bugs.webkit.org/attachment.cgi?id=87733&action=review

------- Additional Comments from Adam Roben (:aroben) <aroben at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=87733&action=review

> Source/WebKit2/WebProcess/WebPage/FindController.cpp:72
>  void FindController::countStringMatches(const String& string, FindOptions
options, unsigned maxMatchCount)
>  {
> -    unsigned matchCount =
m_webPage->corePage()->markAllMatchesForText(string, core(options), false,
maxMatchCount);
> +    unsigned matchCount =
m_webPage->corePage()->markAllMatchesForText(string, core(options), false,
maxMatchCount + 1);
>      m_webPage->corePage()->unmarkAllTextMatches();
>  
> +    // Check if we have more matches than allowed.
> +    if (matchCount > maxMatchCount)
> +	   matchCount = static_cast<unsigned>(kWKMoreThanMaximumMatchCount);

Do we need to worry about someone passing numeric_limits<unsigned>::max() as
the maxMatchCount argument to this function? That would result in underflow.


More information about the webkit-reviews mailing list