Closed Bug 197147 Opened 22 years ago Closed 22 years ago

pk11_InDelayPeriod improperly handles wrap-around of PRIntervalTime

Categories

(NSS :: Libraries, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nelson, Assigned: wtc)

Details

This bug is derived from comments 27 (and later) in bug 167756. pk11_InDelayPeriod doesn't handle wrap-around of the PRIntervalTime properly. Anytime there's a wrap around, it returns false. But the formula that it uses when there is no wrap around, namely: ((time-lastTime) < delayTime); is correct whether there's a wrap around or not, because time, lastTime, and delayTime are all unsigned ints of the same size. So, the solution is to remove the test for wrap around. e.g. time = PR_IntervalNow(); -return (PRBool) (lastTime) && (time > lastTime) && - ((time-lastTime) < delayTime); +return (PRBool) (lastTime) && ((time-lastTime) < delayTime);
Marking P1, since bug 167756 was P1
Priority: -- → P1
Target Milestone: --- → 3.8
I checked in the fix that Nelson suggested. Checking in pk11slot.c; /cvsroot/mozilla/security/nss/lib/pk11wrap/pk11slot.c,v <-- pk11slot.c new revision: 1.60; previous revision: 1.59 done
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.