The length of the new string buffer is computed by CFStringGetMaximumSizeOfFileSystemRepresentation, which over-estimates the required length. To save space, the string buffer is currently reallocated before returning the string. Since the returned string is never stored by any callers as far as I can see, reallocating is not necessary. The caller can reallocate the buffer if the string is going to be stored.
Created attachment 344100 [details] Patch
Comment on attachment 344100 [details] Patch svn blame points to http://trac.webkit.org/r149531, which explains why this is necessary.
(In reply to Alexey Proskuryakov from comment #2) > Comment on attachment 344100 [details] > Patch > > svn blame points to http://trac.webkit.org/r149531, which explains why this > is necessary. Ah, I see. Thanks for reviewing!