Commit 9a6992c48bf08755606d865ba2b3504438789b73

Edward Thomson 2019-05-20T06:46:10

merge: safely cast size of merged file for index Explicitly truncate the file size to a `uint32_t`.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/merge.c b/src/merge.c
index ec34ccb..c1f1cc4 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -867,7 +867,7 @@ static int merge_conflict_invoke_driver(
 
 	git_oid_cpy(&result->id, &oid);
 	result->mode = mode;
-	result->file_size = buf.size;
+	result->file_size = (uint32_t)buf.size;
 
 	result->path = git_pool_strdup(&diff_list->pool, path);
 	GIT_ERROR_CHECK_ALLOC(result->path);