Bug 69011 - FTPDirectoryDocument Shows Garbled String for Last Modified Date
Summary: FTPDirectoryDocument Shows Garbled String for Last Modified Date
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2011-09-28 11:41 PDT by Joseph Pecoraro
Modified: 2011-09-28 13:46 PDT (History)
2 users (show)

See Also:

[PATCH] Proposed Fix (1.55 KB, patch)
2011-09-28 11:57 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2011-09-28 11:41:51 PDT
Opening ftp://ftp.oracle.com in a browser that uses WebCore's FTPDirectoryDocument
was including a semi-garbage incorrect string for the Last Modified Date.

It looks like this was due to a change that removed some string corrosion and
accidentally introduced pointer arithmetic: 

    dateString = months[month] + ' ' + String::number(fileTime.tm_mday) + ", " + String::number(fileTime.tm_year);

The first two pieces are (char* + char) instead of the desired (WTF::String + char) and result
in an unexpected prefix for dateString.

Patch to follow.
Comment 1 Joseph Pecoraro 2011-09-28 11:44:24 PDT
Typo, I meant: "coercion".
Comment 2 Joseph Pecoraro 2011-09-28 11:57:06 PDT
Created attachment 109043 [details]
[PATCH] Proposed Fix

I also switched from + ' ' to + " " which would have caused a compiler issue and help catch
this earlier, but if you want we can switch that space back to a char. The important part
was to force the first expr to be a WTF::String.
Comment 3 WebKit Review Bot 2011-09-28 13:17:42 PDT
Comment on attachment 109043 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 109043

Committed r96253: <http://trac.webkit.org/changeset/96253>
Comment 4 WebKit Review Bot 2011-09-28 13:17:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Joseph Pecoraro 2011-09-28 13:46:05 PDT