mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1189531 - Check for nullptr in convertTimeToDate. r=gerald
In current code it's not possible to pass nullptr, but there's no harm in checking. See also bug 1156891.
This commit is contained in:
parent
75e08b8620
commit
11afc76455
@ -726,8 +726,11 @@ static bool underMetaDataPath(const nsTArray<uint32_t> &path) {
|
||||
|
||||
// Given a time in seconds since Jan 1 1904, produce a human-readable string.
|
||||
static bool convertTimeToDate(int64_t time_1904, String8 *s) {
|
||||
time_t time_1970 = time_1904 - (((66 * 365 + 17) * 24) * 3600);
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
time_t time_1970 = time_1904 - (((66 * 365 + 17) * 24) * 3600);
|
||||
if (time_1970 < 0) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user