mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 9.1.0478: potential deref of NULL pointer in fuzzy_match_str_with_pos
Problem: potential deref of NULL pointer in fuzzy_match_str_with_pos() on cleanup (after v9.1.0476) Solution: Only free the pointer if it is non-NULL (glepnir) closes: #14973 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
1fb9eae579
commit
7c57940e3b
15
src/search.c
15
src/search.c
@@ -5198,11 +5198,16 @@ fuzzy_match_str_with_pos(char_u *str UNUSED, char_u *pat UNUSED)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
vim_free(tv_str.vval.v_string);
|
vim_free(tv_str.vval.v_string);
|
||||||
list_free(match_str_list);
|
if (match_str_list != NULL)
|
||||||
list_free(match_pos_list);
|
list_free(match_str_list);
|
||||||
list_free(match_score_list);
|
if (match_pos_list != NULL)
|
||||||
list_free(retlist);
|
list_free(match_pos_list);
|
||||||
list_free(l);
|
if (match_score_list != NULL)
|
||||||
|
list_free(match_score_list);
|
||||||
|
if (retlist != NULL)
|
||||||
|
list_free(retlist);
|
||||||
|
if (l != NULL)
|
||||||
|
list_free(l);
|
||||||
ga_clear(match_positions);
|
ga_clear(match_positions);
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
|
@@ -704,6 +704,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 */
|
||||||
|
/**/
|
||||||
|
478,
|
||||||
/**/
|
/**/
|
||||||
477,
|
477,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user