Bug 221773 - [Cocoa] IPC decoder is using decoded size to allocate memory for an array
Summary: [Cocoa] IPC decoder is using decoded size to allocate memory for an array
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-11 12:51 PST by Darin Adler
Modified: 2021-04-25 10:51 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.77 KB, patch)
2021-02-11 12:53 PST, Darin Adler
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2021-02-11 12:51:38 PST
[Cocoa] IPC decoder is using decoded size to allocate memory for an array
Comment 1 Darin Adler 2021-02-11 12:53:17 PST
Created attachment 420032 [details]
Patch
Comment 2 Darin Adler 2021-02-11 12:53:50 PST
rdar://72808726
Comment 3 Geoffrey Garen 2021-02-11 13:04:06 PST
Comment on attachment 420032 [details]
Patch

r=me

I wonder if we should honor some safe nominal capacity, like std::min(1024, size), for performance.
Comment 4 Darin Adler 2021-02-11 13:29:08 PST
(In reply to Geoffrey Garen from comment #3)
> I wonder if we should honor some safe nominal capacity, like std::min(1024,
> size), for performance.

We don’t do that for CFArray or for vectors, but I agree that it *might* be a valuable optimization for cases like these.
Comment 5 Darin Adler 2021-02-11 13:30:38 PST
Committed r272744: <https://trac.webkit.org/changeset/272744>