fsmonitor: avoid signed integer overflow / infinite loop
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Sat, 15 Jun 2019 16:11:35 +0000 (09:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jun 2019 01:14:29 +0000 (18:14 -0700)
commit5d137fc2c7ba08455b2734c8e2ca9b9a284f3706
treeb54994239200f16bc8531a97a9886e08868621e5
parentaeb582a98374c094361cba1bd756dc6307432c42
fsmonitor: avoid signed integer overflow / infinite loop

883e248b8a ("fsmonitor: teach git to optionally utilize a file system
monitor to speed up detecting new or changed files.", 2017-09-22) uses
an int in a loop that would wrap if index_state->cache_nr (unsigned)
is bigger than INT_MAX

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c