$OpenBSD: patch-jdk_src_share_classes_sun_misc_FloatingDecimal_java,v 1.1 2011/02/05 23:11:18 ian Exp $

# Fix for DoS caused by very small subnormal double, original fix at 
# https://bugs.openjdk.java.net/show_bug.cgi?id=100119

--- jdk/src/share/classes/sun/misc/FloatingDecimal.java.orig	Sat Feb  5 08:45:51 2011
+++ jdk/src/share/classes/sun/misc/FloatingDecimal.java	Sat Feb  5 08:44:59 2011
@@ -1547,7 +1547,7 @@ public class FloatingDecimal{
                 if ( (cmpResult = bigB.cmp( bigD ) ) > 0 ){
                     overvalue = true; // our candidate is too big.
                     diff = bigB.sub( bigD );
-                    if ( (bigIntNBits == 1) && (bigIntExp > -expBias) ){
+                    if ( (bigIntNBits == 1) && (bigIntExp > -expBias+1) ){
                         // candidate is a normalized exact power of 2 and
                         // is too big. We will be subtracting.
                         // For our purposes, ulp is the ulp of the
