Bug 1371890 - Normalize time returned by ParseFTPList. r=mcmanus

This commit is contained in:
Michal Novotny 2017-07-10 21:34:11 -04:00
Родитель 3d2f150743
Коммит 7dd0c75b98
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -289,6 +289,13 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) {
// MODIFIED DATE
char buffer[256] = "";
// ParseFTPList can return time structure with invalid values.
// PR_NormalizeTime will set all values into valid limits.
result.fe_time.tm_params.tp_gmt_offset = 0;
result.fe_time.tm_params.tp_dst_offset = 0;
PR_NormalizeTime(&result.fe_time, PR_GMTParameters);
// Note: The below is the RFC822/1123 format, as required by
// the application/http-index-format specs
// viewers of such a format can then reformat this into the