DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39838>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39838

           Summary: patches to prevent integer overflow
           Product: Batik
           Version: 1.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Utilities
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


after the recent 'buhei' about the buggy binary search in the jdk (see
javalobby.org i decided to check the batik-source for similar 'sleepers'.
I dont think that this is an urgent work to prevent immediate problems, but...
someone stepped on the that bug and reported in sun's bugbase.
If a problem is so easy to wipe out, it should be done.
The problem with binary search and those i fixed in the attached patches is
something like this:
  mid = (low + high) / 2; // java.util
or  // in batik
  newSize = ( size * 3 ) >> 2;   // that is: (size * 3) / 4 = 0.75
the intermediate result of ( size * 3) may overflow to negative and causing
problems later on.
The cure is to rewrite the expression in an 'overflow-avoiding' way:
  newSize = ( size - ( size >> 2 ));    // that is ( size - size/4) = 0.75

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to