[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5766-g98bbd6b

Brad King brad.king at kitware.com
Mon Nov 25 11:18:22 EST 2013


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  98bbd6be823b4f605ed04d75a1967b0e121e9597 (commit)
       via  5ee1297d6be6ffc946ac4b7947bfd60443583afc (commit)
      from  808d7d290e079c4bf7a2729d1158a77b4d113167 (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=98bbd6be823b4f605ed04d75a1967b0e121e9597
commit 98bbd6be823b4f605ed04d75a1967b0e121e9597
Merge: 808d7d2 5ee1297
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 25 11:18:17 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 25 11:18:17 2013 -0500

    Merge topic 'libarchive-left-shift-fix' into next
    
    5ee1297 libarchive: Port upstream issue 320 fix


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ee1297d6be6ffc946ac4b7947bfd60443583afc
commit 5ee1297d6be6ffc946ac4b7947bfd60443583afc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 25 11:16:45 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 25 11:16:45 2013 -0500

    libarchive: Port upstream issue 320 fix
    
    Port upstream commit 533e8fda (Rework the sign-extension to avoid
    left-shift of an explicit negative number, 2013-06-29) into CMake.
    
    Inspired-by: Tim Kientzle <kientzle at freebsd.org>

diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
index e9523cb..a4dc710 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
@@ -2475,20 +2475,16 @@ tar_atol256(const char *_p, size_t char_cnt)
 	upper_limit = INT64_MAX / 256;
 	lower_limit = INT64_MIN / 256;
 
-	/* Pad with 1 or 0 bits, depending on sign. */
+	/* Sign-extend the 7-bit value to 64 bits. */
 	if ((0x40 & *p) == 0x40)
-		l = (int64_t)-1;
+		l = ~((int64_t)0x3f) | *p++;
 	else
-		l = 0;
-	l = (l << 6) | (0x3f & *p++);
+		l = 0x3f & *p++;
 	while (--char_cnt > 0) {
-		if (l > upper_limit) {
-			l = INT64_MAX; /* Truncate on overflow */
-			break;
-		} else if (l < lower_limit) {
-			l = INT64_MIN;
-			break;
-		}
+		if (l > upper_limit)
+			return (INT64_MAX); /* Truncate on overflow */
+		else if (l < lower_limit)
+			return (INT64_MIN);
 		l = (l << 8) | (0xff & (int64_t)*p++);
 	}
 	return (l);

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

Summary of changes:
 .../libarchive/archive_read_support_format_tar.c   |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list