Skip to content

Commit c83cce4

Browse files
committed
Merge branch 'cb/fsmonitor-intfix' into pu
* cb/fsmonitor-intfix: fsmonitor: avoid signed integer overflow / infinite loop
2 parents 8496a9d + 5d137fc commit c83cce4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fsmonitor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int read_fsmonitor_extension(struct index_state *istate, const void *data,
5656

5757
void fill_fsmonitor_bitmap(struct index_state *istate)
5858
{
59-
int i;
59+
unsigned int i;
6060
istate->fsmonitor_dirty = ewah_new();
6161
for (i = 0; i < istate->cache_nr; i++)
6262
if (!(istate->cache[i]->ce_flags & CE_FSMONITOR_VALID))
@@ -134,7 +134,7 @@ void refresh_fsmonitor(struct index_state *istate)
134134
size_t bol; /* beginning of line */
135135
uint64_t last_update;
136136
char *buf;
137-
int i;
137+
unsigned int i;
138138

139139
if (!core_fsmonitor || istate->fsmonitor_has_run_once)
140140
return;
@@ -192,7 +192,7 @@ void refresh_fsmonitor(struct index_state *istate)
192192

193193
void add_fsmonitor(struct index_state *istate)
194194
{
195-
int i;
195+
unsigned int i;
196196

197197
if (!istate->fsmonitor_last_update) {
198198
trace_printf_key(&trace_fsmonitor, "add fsmonitor");
@@ -225,7 +225,7 @@ void remove_fsmonitor(struct index_state *istate)
225225

226226
void tweak_fsmonitor(struct index_state *istate)
227227
{
228-
int i;
228+
unsigned int i;
229229
int fsmonitor_enabled = git_config_get_fsmonitor();
230230

231231
if (istate->fsmonitor_dirty) {

0 commit comments

Comments
 (0)