[libgsf] Zip: write ddesc with a signature.



commit ddb754e4b985255ecee69516108a6437df000208
Author: Morten Welinder <terra gnome org>
Date:   Sat Nov 29 12:40:31 2014 -0500

    Zip: write ddesc with a signature.
    
    The spec is unclear if we should do so.  Code is not currently
    reachable.

 ChangeLog             |    2 ++
 gsf/gsf-outfile-zip.c |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8477beb..b048e94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * gsf/gsf-outfile-zip.c (gsf_outfile_zip_class_init): Properly
        install zip64 property.
+       (zip_header_write): Fix auto-zip64 mode's writing of sizes.
+       (zip_ddesc_write): Do write signature.
 
 2014-11-28  Morten Welinder  <terra gnome org>
 
diff --git a/gsf/gsf-outfile-zip.c b/gsf/gsf-outfile-zip.c
index 4ea3813..dccbac9 100644
--- a/gsf/gsf-outfile-zip.c
+++ b/gsf/gsf-outfile-zip.c
@@ -512,9 +512,9 @@ zip_header_write (GsfOutfileZip *zip)
        GSF_LE_SET_GUINT32 (hbuf + ZIP_HEADER_DOSTIME, dirent->dostime);
        GSF_LE_SET_GUINT32 (hbuf + ZIP_HEADER_CRC32, crc32);
        GSF_LE_SET_GUINT32 (hbuf + ZIP_HEADER_CSIZE,
-                           dirent->zip64 ? G_MAXUINT32 : csize);
+                           real_zip64 ? G_MAXUINT32 : csize);
        GSF_LE_SET_GUINT32 (hbuf + ZIP_HEADER_USIZE,
-                           dirent->zip64 ? G_MAXUINT32 : usize);
+                           real_zip64 ? G_MAXUINT32 : usize);
        GSF_LE_SET_GUINT16 (hbuf + ZIP_HEADER_NAME_SIZE, nlen);
        GSF_LE_SET_GUINT16 (hbuf + ZIP_HEADER_EXTRAS_SIZE, extras->len);
 
@@ -638,7 +638,7 @@ zip_ddesc_write (GsfOutfileZip *zip)
                size = ZIP_DDESC_SIZE;
        }
 
-       if (!gsf_output_write (zip->sink, size - 4, buf + 4)) {
+       if (!gsf_output_write (zip->sink, size, buf)) {
                return FALSE;
        }
 


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