xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39838] New: - patches to prevent integer overflow
Date Mon, 19 Jun 2006 20:12:46 GMT
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: batik-dev@xmlgraphics.apache.org
        ReportedBy: info@dvholten.de


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: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


Mime
View raw message