[webkit-reviews] review granted: [Bug 221544] NetworkRTCSocketCocoa extractDataMessages should not read too much data : [Attachment 419588] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 8 08:49:07 PST 2021


Eric Carlson <eric.carlson at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 221544: NetworkRTCSocketCocoa extractDataMessages should not read too much
data
https://bugs.webkit.org/show_bug.cgi?id=221544

Attachment 419588: Patch

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




--- Comment #4 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 419588
  --> https://bugs.webkit.org/attachment.cgi?id=419588
Patch

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

> Source/WebCore/Modules/mediastream/STUNMessageParsing.cpp:96
> +	   bool canReadLength = size >= 2;
> +	   size_t length = canReadLength ? be16toh(*reinterpret_cast<const
uint16_t*>(data)) : 0;
> +	   if (!canReadLength || length > size - 2) {

`2` would be better as a named const initialized with sizeof

> Source/WebCore/Modules/mediastream/STUNMessageParsing.cpp:106
> +	   data += 2;
> +	   size -= 2;

Ditto


More information about the webkit-reviews mailing list