Closed Bug 11505 Opened 25 years ago Closed 25 years ago

Division by zero possible in nsBoxFrame.cpp

Categories

(Core :: Layout, defect, P3)

DEC
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: niles, Assigned: eric)

Details

There's probably something else wrong, but allowing division by zero seems like a bad idea and will crash mozilla on Linux/Alpha without this patch. If you want to assert that it's not zero you should state it explicitly..i.e. assert(springConstantsRemaining != 0). Index: nsBoxFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/xul/base/src/nsBoxFrame.cpp,v retrieving revision 1.24 diff -r1.24 nsBoxFrame.cpp 924,925c924,927 < < float stretchFactor = sizeRemaining/springConstantsRemaining; --- > > float stretchFactor = 1; > if(springConstantsRemaining) > stretchFactor = sizeRemaining/springConstantsRemaining;
Assignee: troy → evaughan
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
This has been fixed. Divide by zero should not happen.
Status: RESOLVED → VERIFIED
Based on the comment's below, marking as verified fixed.
You need to log in before you can comment on or make changes to this bug.