[webkit-reviews] review granted: [Bug 212412] REGRESSION(r260318): [WPE][GTK] Uninitialized memory read in MemoryPressureMonitor : [Attachment 400342] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 27 14:08:35 PDT 2020


Adrian Perez <aperez at igalia.com> has granted Michael Catanzaro
<mcatanzaro at gnome.org>'s request for review:
Bug 212412: REGRESSION(r260318): [WPE][GTK] Uninitialized memory read in
MemoryPressureMonitor
https://bugs.webkit.org/show_bug.cgi?id=212412

Attachment 400342: Patch

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




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

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

> Source/WebKit/ChangeLog:8
> +	   I think this is a false-positive, but let's suppress the warning by
zero-initializing this

Seems so…

> Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:234
> +	   char token[MEMINFO_TOKEN_BUFFER_SIZE + 1] = { 0 };

…because the “token” variable is only used if the “fscanf()” call below
returns “2”, meaning that it successfully scanned two elements, and when
it scans a string, at always adds a terminating '\0' to the buffer.

Anyhoo, let's land this, initializing the variable is good.


More information about the webkit-reviews mailing list