[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2321-g561aaa0

Brad King brad.king at kitware.com
Tue Apr 15 09:14:22 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  561aaa03f65762b0e75e049dc12dc5c4fd458f69 (commit)
       via  6ab7c326485b4af46a4e45faef2ac7d469df8840 (commit)
      from  7f58219a1fcc19a2e6c18bba985681eaf26ad19f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=561aaa03f65762b0e75e049dc12dc5c4fd458f69
commit 561aaa03f65762b0e75e049dc12dc5c4fd458f69
Merge: 7f58219 6ab7c32
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 15 09:14:21 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 15 09:14:21 2014 -0400

    Merge topic 'update-libarchive' into next
    
    6ab7c326 libarchive: Avoid left-shift overflow of signed integer


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ab7c326485b4af46a4e45faef2ac7d469df8840
commit 6ab7c326485b4af46a4e45faef2ac7d469df8840
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 15 09:07:48 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 15 09:08:20 2014 -0400

    libarchive: Avoid left-shift overflow of signed integer
    
    In libarchive/archive_write_set_format_zip.c there are two calls to
    archive_le32enc whose second argument is of the form
    
     archive_entry_mode(zip->entry) << 16
    
    However, the return type from archive_entry_mode may be a signed integer
    so the shift may overflow.  Since the second argument of archive_le32enc
    expects uint32_t anyway, simply cast to that prior to shifting.

diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
index d856b2a..157f100 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
@@ -621,7 +621,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
 	archive_le16enc(zip->file_header + 28, filename_length);
 	/* Following Info-Zip, store mode in the "external attributes" field. */
 	archive_le32enc(zip->file_header + 38,
-	    archive_entry_mode(zip->entry) << 16);
+	    ((uint32_t)archive_entry_mode(zip->entry)) << 16);
 	e = cd_alloc(zip, filename_length);
 	/* If (e == NULL) XXXX */
 	copy_path(zip->entry, e);
@@ -714,7 +714,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
 		}
 		if (included & 4) {
 			archive_le32enc(e,  /* external file attributes */
-			    archive_entry_mode(zip->entry) << 16);
+			    ((uint32_t)archive_entry_mode(zip->entry)) << 16);
 			e += 4;
 		}
 		if (included & 8) {

-----------------------------------------------------------------------

Summary of changes:
 Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list