ebourg opened a new pull request, #731:
URL: https://github.com/apache/poi/pull/731

   This is a follow up to #182, which didn't cover all possibles cases of gaps 
in the allocation table of the mini stream.
   
   This PR contains a unit test generating a file with the following layout:
   * Minit FAT Sector 1 is unallocated
   * Minit FAT Sector 2 has 8 unallocated mini sectors at the beginning
   * Minit FAT Sector 3 has 4 unallocated mini sectors in the middle
   * Minit FAT Sector 4 is unallocated
   * Minit FAT Sector 5 has 32 unallocated mini sectors at the end
   * Minit FAT Sector 6 has 64 unallocated sectors at the beginning and 16 
unallocated mini sectors at the end
   * Minit FAT Sector 7 is unallocated
   * Minit FAT Sector 8 is unallocated
   
   With this layout POI 5.3 computes a mini stream size of 29696 bytes, that is 
the sum of the "occupied" bytes (as per `BATBlock.getOccupiedSize()`) for each 
sector : (0 + 128 + 128 + 0 + (128-32) + (128-16) + 0 + 0) x 64.
   
   After signing the file with signtool:
   * The first 2 mini sectors of the first mini FAT sector have been allocated 
(for the MsiDigitalSignatureEx entry)
   * The empty mini FAT sectors 4, 7 and 8 were not removed
   * The size field of the root entry is 48128 bytes, that's (5 x 128 + (128 - 
16)) x 64
   
   So the right method to compute the size is to find the absolute index of the 
last allocated mini sector, add one and multiply by 64.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to