summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-07-22 12:53:13 -0400
committerEdward Thomson <ethomson@github.com>2016-07-24 15:49:19 -0400
commit4aaae9354cd12cdd2658696b2506b02fa584e776 (patch)
treeb7e18c9856352864e4cae32d146bfa5a7ca4e41b
parent498d0801a1348248f7759436e6cc464cc11b2205 (diff)
downloadlibgit2-4aaae9354cd12cdd2658696b2506b02fa584e776.tar.gz
index: cast to avoid warning
-rw-r--r--src/index.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/index.c b/src/index.c
index 6546ea18a..9908ba64b 100644
--- a/src/index.c
+++ b/src/index.c
@@ -2160,12 +2160,12 @@ static int read_reuc(git_index *index, const char *buffer, size_t size)
if (git__strtol64(&tmp, buffer, &endptr, 8) < 0 ||
!endptr || endptr == buffer || *endptr ||
- tmp < 0) {
+ tmp < 0 || tmp > UINT32_MAX) {
index_entry_reuc_free(lost);
return index_error_invalid("reading reuc entry stage");
}
- lost->mode[i] = tmp;
+ lost->mode[i] = (uint32_t)tmp;
len = (endptr + 1) - buffer;
if (size <= len) {