Bug 100180 - Stop using NSHomeDirectory() to get the home directory, it doesn't always return what we want
Summary: Stop using NSHomeDirectory() to get the home directory, it doesn't always ret...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-23 19:17 PDT by Sam Weinig
Modified: 2012-10-24 07:58 PDT (History)
0 users

See Also:


Attachments
Patch (4.14 KB, patch)
2012-10-23 19:19 PDT, Sam Weinig
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2012-10-23 19:17:22 PDT
Stop using NSHomeDirectory() to get the home directory, it doesn't always return what we want
Comment 1 Sam Weinig 2012-10-23 19:19:10 PDT
Created attachment 170293 [details]
Patch
Comment 2 Anders Carlsson 2012-10-23 19:22:36 PDT
Comment on attachment 170293 [details]
Patch

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

> Source/WebKit2/WebProcess/mac/WebProcessMac.mm:214
> +    int bufferSize = 4096;
> +    char buffer[4096];

Please write this as

char buffer[4096];
int bufferSize = sizeof(buffer);
Comment 3 Sam Weinig 2012-10-23 19:53:12 PDT
Committed r132294: <http://trac.webkit.org/changeset/132294>
Comment 4 Darin Adler 2012-10-24 07:58:02 PDT
Comment on attachment 170293 [details]
Patch

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

>> Source/WebKit2/WebProcess/mac/WebProcessMac.mm:214
>> +    char buffer[4096];
> 
> Please write this as
> 
> char buffer[4096];
> int bufferSize = sizeof(buffer);

Is 4096 better than PATH_MAX or MAXPATHLEN?