Closed
Bug 11505
Opened 25 years ago
Closed 25 years ago
Division by zero possible in nsBoxFrame.cpp
Categories
(Core :: Layout, defect, P3)
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 | ||
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 1•25 years ago
|
||
This has been fixed. Divide by zero should not happen.
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Comment 2•25 years ago
|
||
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.
Description
•