Skip to content

Commit a552e50

Browse files
mhaggergitster
authored andcommitted
ref_update_reject_duplicates(): use size_t rather than int
Eliminate a theoretical risk of integer overflow if the two types have different sizes. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2ced105 commit a552e50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
17051705
int ref_update_reject_duplicates(struct string_list *refnames,
17061706
struct strbuf *err)
17071707
{
1708-
int i, n = refnames->nr;
1708+
size_t i, n = refnames->nr;
17091709

17101710
assert(err);
17111711

0 commit comments

Comments
 (0)