[libgsf] Fix ZIP64 EOCD size to exclude leading 12 bytes



commit 94c66f8cf3ef9d3d616fbb2c3a02aa479ddcbff6
Author: Felix Bùˆnemann <buenemann louis info>
Date:   Sun May 29 05:40:50 2016 +0200

    Fix ZIP64 EOCD size to exclude leading 12 bytes
    
    From the PKWARE spec:
    
    4.3.14.1 The value stored into the "size of zip64 end of central
    directory record" should be the size of the remaining
    record and should not include the leading 12 bytes.
    
    Size = SizeOfFixedFields + SizeOfVariableData - 12.

 gsf/gsf-outfile-zip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsf/gsf-outfile-zip.c b/gsf/gsf-outfile-zip.c
index 519b7a3..e1e101f 100644
--- a/gsf/gsf-outfile-zip.c
+++ b/gsf/gsf-outfile-zip.c
@@ -300,7 +300,7 @@ zip_trailer64_write (GsfOutfileZip *zip, unsigned entries,
 
        memset (buf, 0, sizeof buf);
        GSF_LE_SET_GUINT32 (buf, ZIP_TRAILER64_SIGNATURE);
-       GSF_LE_SET_GUINT64 (buf + ZIP_TRAILER64_RECSIZE, sizeof buf);
+       GSF_LE_SET_GUINT64 (buf + ZIP_TRAILER64_RECSIZE, sizeof buf - 12);
        GSF_LE_SET_GUINT16 (buf + ZIP_TRAILER64_ENCODER,
                            (ZIP_OS_UNIX << 8) + extract);
        GSF_LE_SET_GUINT16 (buf + ZIP_TRAILER64_EXTRACT,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]