$OpenBSD: patch-j2se_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

--- j2se/src/share/classes/sun/misc/FloatingDecimal.java.orig	Sat Feb  5 08:25:48 2011
+++ j2se/src/share/classes/sun/misc/FloatingDecimal.java	Sat Feb  5 08:31:10 2011
@@ -1529,7 +1529,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
