[Webkit-unassigned] [Bug 207497] PersistentCoders should use modern decoding syntax

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 11 22:09:26 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=207497

--- Comment #10 from Fujii Hironori <Hironori.Fujii at sony.com> ---
Comment on attachment 390285
  --> https://bugs.webkit.org/attachment.cgi?id=390285
patch

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

> Source/WTF/wtf/persistence/PersistentCoders.h:135
> +        tmp.reserveInitialCapacity(*size);

You added reserveInitialCapacity here.
It is dangerous to allocate memory without check bufferIsLargeEnoughToContain.
Use tryReserveCapacity and check the result.

> Source/WTF/wtf/persistence/PersistentCoders.h:201
> +        tempHashMap.reserveInitialCapacity(static_cast<unsigned>(*hashMapSize));

HashMap should have tryReserveCapacity method.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200212/978d48cf/attachment-0001.htm>


More information about the webkit-unassigned mailing list