Ignore:
Timestamp:
04/25/10 13:46:15 (10 years ago)
Author:
melissa
Message:
  • Updated remaining readers to respect MetadataOptions.
  • Added bounds checking to MDB Tools' text field retrieval.
  • Reverted one of the changes to RandomAccessInputStream.findString in r6188.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/forks/mdbtools/src/mdbtools/libmdb/Data.java

    r6026 r6190  
    663663    { 
    664664      /* inline memo field */ 
    665       text = new String(mdb.pg_buf,start+Constants.MDB_MEMO_OVERHEAD + 2,size - Constants.MDB_MEMO_OVERHEAD - 2); 
     665      int begin = start + Constants.MDB_MEMO_OVERHEAD + 2; 
     666      int end = size - Constants.MDB_MEMO_OVERHEAD - 2; 
     667      if (begin >= 0 && begin < mdb.pg_buf.length && end > 0 && 
     668        begin + end <= mdb.pg_buf.length) 
     669      { 
     670        text = new String(mdb.pg_buf, begin, end); 
     671      } 
    666672//      strncpy(text, &mdb->pg_buf[start + MDB_MEMO_OVERHEAD],size - MDB_MEMO_OVERHEAD); 
    667673//      text[size - MDB_MEMO_OVERHEAD]='\0'; 
Note: See TracChangeset for help on using the changeset viewer.