-
Bug
-
Resolution: Fixed
-
P4
-
17
-
b22
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8274984 | 11.0.14-oracle | Dmitry Markov | P4 | Resolved | Fixed | b01 |
JDK-8273226 | 11.0.14 | Matthias Baesken | P4 | Resolved | Fixed | b01 |
In java/awt/font/TextJustifier.java justify there is a potential code path where divison by zero might happen , see also the Sonar finding :
https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXcqMwpm8sPJZZzONu1k&resolved=false&severities=CRITICAL&types=BUG
boolean hitLimit = (weight == 0) || (!lastPass && ((delta < 0) == (delta < gslimit)));
boolean absorbing = hitLimit && absorbweight > 0;
// predivide delta by weight
float weightedDelta = delta / weight; // not used if weight == 0
In case of (weight == 0) the division should not be done because the value of weightedDelta is unused in this case anyway.
https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXcqMwpm8sPJZZzONu1k&resolved=false&severities=CRITICAL&types=BUG
boolean hitLimit = (weight == 0) || (!lastPass && ((delta < 0) == (delta < gslimit)));
boolean absorbing = hitLimit && absorbweight > 0;
// predivide delta by weight
float weightedDelta = delta / weight; // not used if weight == 0
In case of (weight == 0) the division should not be done because the value of weightedDelta is unused in this case anyway.
- backported by
-
JDK-8273226 Avoid division by 0 in java/awt/font/TextJustifier.java justify
- Resolved
-
JDK-8274984 Avoid division by 0 in java/awt/font/TextJustifier.java justify
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/d41b37ff
-
Commit openjdk/jdk/ea30bd66
-
Review openjdk/jdk11u-dev/303
-
Review openjdk/jdk/2912
(1 links to)