Bug 41548 - Use snprintf instead of sprintf everywhere in JavaScriptCore
Summary: Use snprintf instead of sprintf everywhere in JavaScriptCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 16:23 PDT by Sam Weinig
Modified: 2010-07-02 16:28 PDT (History)
0 users

See Also:


Attachments
Patch (2.65 KB, patch)
2010-07-02 16:24 PDT, Sam Weinig
ggaren: review+
darin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2010-07-02 16:23:28 PDT
Use snprintf instead of sprintf everywhere in JavaScriptCore.
Comment 1 Sam Weinig 2010-07-02 16:24:23 PDT
Created attachment 60417 [details]
Patch
Comment 2 Geoffrey Garen 2010-07-02 16:25:29 PDT
Comment on attachment 60417 [details]
Patch

r=me
Comment 3 Sam Weinig 2010-07-02 16:27:11 PDT
Landed in r62414.
Comment 4 Darin Adler 2010-07-02 16:28:26 PDT
Comment on attachment 60417 [details]
Patch

JSGlobalObjectFunctions.cpp includes <string.h>, but now that it's using snprintf I think it needs to include StringExtras.h instead to avoid breaking the Windows build.

review+ if you fix that.

Also: UString::from(long long) uses snprintf, and for some reason passes sizeof(minBuf) - 1. WTF is up with that?

And: UString.cpp seems to include StringExtras.h twice and also includes <string.h> unnecessarily since StringExtras.h includes that.