]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
If you overflow an int64_t, use INT64_MAX, not UINT64_MAX.
authorTim Kientzle <kientzle@gmail.com>
Sun, 8 Nov 2009 22:28:50 +0000 (17:28 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 8 Nov 2009 22:28:50 +0000 (17:28 -0500)
SVN-Revision: 1613

libarchive/archive_read_support_format_mtree.c
libarchive/archive_read_support_format_tar.c

index 6328c4d8f76b711d3af91f9cc4e09f9e3f300bf1..f9ae245bef6c93245c0b51c4bc5102cbae162418 100644 (file)
@@ -1159,7 +1159,7 @@ mtree_atol10(char **p)
        digit = **p - '0';
        while (digit >= 0 && digit < base) {
                if (l > limit || (l == limit && digit > last_digit_limit)) {
-                       l = UINT64_MAX; /* Truncate on overflow. */
+                       l = INT64_MAX; /* Truncate on overflow. */
                        break;
                }
                l = (l * base) + digit;
@@ -1200,7 +1200,7 @@ mtree_atol16(char **p)
                digit = -1;
        while (digit >= 0 && digit < base) {
                if (l > limit || (l == limit && digit > last_digit_limit)) {
-                       l = UINT64_MAX; /* Truncate on overflow. */
+                       l = INT64_MAX; /* Truncate on overflow. */
                        break;
                }
                l = (l * base) + digit;
index b2700ba42289a642ca08aa2a734942cc38752497..716ecd79e40729b299912c83acd9b1b31ef23e0a 100644 (file)
@@ -1630,7 +1630,7 @@ pax_time(const char *p, int64_t *ps, long *pn)
                digit = *p - '0';
                if (s > limit ||
                    (s == limit && digit > last_digit_limit)) {
-                       s = UINT64_MAX;
+                       s = INT64_MAX;
                        break;
                }
                s = (s * 10) + digit;
@@ -1929,7 +1929,7 @@ gnu_sparse_10_atol(struct archive_read *a, struct tar *tar,
                        return (ARCHIVE_WARN);
                digit = *p - '0';
                if (l > limit || (l == limit && digit > last_digit_limit))
-                       l = UINT64_MAX; /* Truncate on overflow. */
+                       l = INT64_MAX; /* Truncate on overflow. */
                else
                        l = (l * base) + digit;
                p++;
@@ -2035,7 +2035,7 @@ tar_atol8(const char *p, unsigned char_cnt)
        digit = *p - '0';
        while (digit >= 0 && digit < base  && char_cnt-- > 0) {
                if (l>limit || (l == limit && digit > last_digit_limit)) {
-                       l = UINT64_MAX; /* Truncate on overflow. */
+                       l = INT64_MAX; /* Truncate on overflow. */
                        break;
                }
                l = (l * base) + digit;
@@ -2071,7 +2071,7 @@ tar_atol10(const char *p, unsigned char_cnt)
        digit = *p - '0';
        while (digit >= 0 && digit < base  && char_cnt-- > 0) {
                if (l > limit || (l == limit && digit > last_digit_limit)) {
-                       l = UINT64_MAX; /* Truncate on overflow. */
+                       l = INT64_MAX; /* Truncate on overflow. */
                        break;
                }
                l = (l * base) + digit;