Changeset 154 for trunk/lib


Ignore:
Timestamp:
06/03/09 11:21:47 (15 years ago)
Author:
tim
Message:

fixed a parsing flaw in big data chunk concatenation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/regfi.c

    r152 r154  
    23962396    }
    23972397
    2398     if(chunk_length-4 > data_left)
     2398    /* XXX: This should be "chunk_length-4" to account for the 4 byte cell
     2399     *      length.  However, it has been observed that some (all?) chunks
     2400     *      have an additional 4 bytes of 0 at the end of their cells that
     2401     *      isn't part of the data, so we're trimming that off too.
     2402     */
     2403    if(chunk_length-8 >= data_left)
    23992404      read_length = data_left;
    24002405    else
    2401       read_length = chunk_length-4;
     2406      read_length = chunk_length-8;
    24022407
    24032408    if(regfi_read(file->fd, ret_val.buf+(data_length-data_left),
     
    24152420    data_left -= read_length;
    24162421  }
    2417 
    24182422  free(indirect_ptrs);
    24192423  ret_val.len = data_length-data_left;
     2424
    24202425  return ret_val;
    24212426
Note: See TracChangeset for help on using the changeset viewer.