mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 7.4.2361
Problem: Checking for last_timer_id to overflow is not reliable. (Ozaki Kiichi) Solution: Check for the number not going up.
This commit is contained in:
@@ -1143,10 +1143,11 @@ free_timer(timer_T *timer)
|
|||||||
create_timer(long msec, int repeat)
|
create_timer(long msec, int repeat)
|
||||||
{
|
{
|
||||||
timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T));
|
timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T));
|
||||||
|
long prev_id = last_timer_id;
|
||||||
|
|
||||||
if (timer == NULL)
|
if (timer == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (++last_timer_id < 0)
|
if (++last_timer_id <= prev_id)
|
||||||
/* Overflow! Might cause duplicates... */
|
/* Overflow! Might cause duplicates... */
|
||||||
last_timer_id = 0;
|
last_timer_id = 0;
|
||||||
timer->tr_id = last_timer_id;
|
timer->tr_id = last_timer_id;
|
||||||
|
@@ -763,6 +763,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2361,
|
||||||
/**/
|
/**/
|
||||||
2360,
|
2360,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user