Bug 216709

Summary: console APIs shouldn't crash making a string that's too long for a console warning when using user provided labels
Product: WebKit Reporter: Saam Barati <saam>
Component: Web InspectorAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=224698
Attachments:
Description Flags
patch
none
patch
mark.lam: review+
patch for landing none

Description Saam Barati 2020-09-18 11:22:55 PDT
...
Comment 1 Saam Barati 2020-09-18 11:23:29 PDT
<rdar://problem/68275357>
Comment 2 Saam Barati 2020-09-18 11:40:40 PDT
Created attachment 409154 [details]
patch
Comment 3 Saam Barati 2020-09-18 11:41:02 PDT
Comment on attachment 409154 [details]
patch

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

> LayoutTests/inspector/console/console-count-reset-oom.html:14
> +            console.countReset('a'.repeat(2**31-1));

gonna try to write tests for all the places I changed.
Comment 4 Saam Barati 2020-09-18 12:04:44 PDT
Created attachment 409158 [details]
patch
Comment 5 Mark Lam 2020-09-18 12:28:08 PDT
Comment on attachment 409158 [details]
patch

r=me
Comment 6 Devin Rousso 2020-09-18 13:57:47 PDT
Comment on attachment 409158 [details]
patch

r=me as well :)

FYI this also could happen in
 - `JSGlobalObjectConsoleClient::profile`
 - `JSGlobalObjectConsoleClient::profileEnd`
 - `JSGlobalObjectInspectorController::reportAPIException`
 - `InspectorTimelineAgent::startFromConsole`
 - `InspectorTimelineAgent::stopFromConsole`
 - `WebConsoleAgent::didReceiveResponse`
 - `WebConsoleAgent::didFailLoading`
Comment 7 Saam Barati 2020-09-18 16:14:19 PDT
Created attachment 409176 [details]
patch for landing
Comment 8 EWS 2020-09-18 17:27:11 PDT
Committed r267301: <https://trac.webkit.org/changeset/267301>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409176 [details].