Closed Bug 236879 Opened 21 years ago Closed 21 years ago

PR_LocalTimeParameters should also check for values that are too small for 32-bit time_t.

Categories

(NSPR :: NSPR, defect)

4.4.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

References

Details

Attachments

(1 file)

In PR_LocalTimeParameters, we need to assign a 64-bit integer (secs64) to time_t (secs). In order to prevent overflow of a 32-bit time_t, we check to make sure that secs64 is <= the maximum 32-bit integer. We should also check to make sure that secs64 is >= the minimum 32-bit integer. This problem was first identified in bug 172908 comment 5. It causes dates before 14 Dec 1901 to not work with NSPR.
Attached patch Proposed patchSplinter Review
Attachment #143352 - Flags: review?(darin)
Comment on attachment 143352 [details] [diff] [review] Proposed patch r=darin
Attachment #143352 - Flags: review?(darin) → review+
patch landed on NSPRPUB_PRE_4_2_CLIENT_BRANCH for 1.7 beta. leaving open for wtc to land patch on NSPR trunk.
Patch checked in on the NSPR trunk for NSPR 4.5.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.5
Blocks: 172908
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: