[webkit-reviews] review denied: [Bug 209464] Replacing atoll with strtoull in MemoryPressureMonitor.cpp : [Attachment 394354] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 24 01:33:34 PDT 2020


Adrian Perez <aperez at igalia.com> has denied Pablo Saavedra
<psaavedra at igalia.com>'s request for review:
Bug 209464: Replacing atoll with strtoull in MemoryPressureMonitor.cpp
https://bugs.webkit.org/show_bug.cgi?id=209464

Attachment 394354: patch

https://bugs.webkit.org/attachment.cgi?id=394354&action=review




--- Comment #2 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 394354
  --> https://bugs.webkit.org/attachment.cgi?id=394354
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394354&action=review

> Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:87
> +	       low += strtoull(token, nullptr, 10);

This is not doing any error checking to ensure that the parsing was
successful. There are also a generic string-to-integer conversion
function in WTF which you could use here:

  bool ok = true;
  low += WTF::toIntegralType<size_t, UChar>(token, strlen(token), &ok, 10);
  if (!ok) return 0;  // Return early on error.

…and so on for the rest of the conversions.


More information about the webkit-reviews mailing list