[Bug general/4679] New: StatelessFile bound checks does not work on 64 bit

pmuldoon at redhat dot com sourceware-bugzilla@sourceware.org
Thu Jun 21 00:40:00 GMT 2007


The below code won't work as java longs are signed, so values in the upper
address range will be represented as negative decimal numbers for the purposes
of the < 0 decimal comparisons. So a read at 0xffffffffff600000 will fail as
when rendered to a singed long it will be a negative decimal value in the
comparison and the <0 test will fail.

static void
verifyBounds (jlong fileOffset, jbyteArray bytes, jlong start, jlong length)
{

  // XXX: 64-bit?
  if (fileOffset < 0)
    throw new java::lang::ArrayIndexOutOfBoundsException ();
  if (start < 0)
    throw new java::lang::ArrayIndexOutOfBoundsException ();
  if (length < 0)
    throw new java::lang::ArrayIndexOutOfBoundsException ();
  if (start + length > bytes->length)
    throw new java::lang::ArrayIndexOutOfBoundsException ();
}

-- 
           Summary: StatelessFile bound checks does not work on 64 bit
           Product: frysk
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: frysk-bugzilla at sourceware dot org
        ReportedBy: pmuldoon at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4679

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Frysk-bugzilla mailing list