mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0155: ubsan complains about NULL pointer
Problem: When sorting zero elements a NULL pointer is passed to qsort(), which ubsan warns for. Solution: Don't call qsort() if there are no elements. (Dominique Pelle)
This commit is contained in:
@@ -6704,7 +6704,9 @@ syntime_report(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sort on total time */
|
/* Sort on total time. Skip if there are no items to avoid passing NULL
|
||||||
|
* pointer to qsort(). */
|
||||||
|
if (ga.ga_len > 1)
|
||||||
qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T),
|
qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T),
|
||||||
syn_compare_syntime);
|
syn_compare_syntime);
|
||||||
|
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
155,
|
||||||
/**/
|
/**/
|
||||||
154,
|
154,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user