Mercurial > vim
comparison src/insexpand.c @ 26452:65b4109a4297 v8.2.3756
patch 8.2.3756: might crash when callback is not valid
Commit: https://github.com/vim/vim/commit/4dc24eb5adbcc76838fae1e900936dd230209d96
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Dec 7 12:23:57 2021 +0000
patch 8.2.3756: might crash when callback is not valid
Problem: might crash when callback is not valid.
Solution: Check for valid callback. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9293)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 07 Dec 2021 13:30:05 +0100 |
parents | 8aba638e91eb |
children | 13ba00ef7687 |
comparison
equal
deleted
inserted
replaced
26451:27720705109b | 26452:65b4109a4297 |
---|---|
2327 int retval; | 2327 int retval; |
2328 | 2328 |
2329 if (*curbuf->b_p_tsrfu != NUL) | 2329 if (*curbuf->b_p_tsrfu != NUL) |
2330 { | 2330 { |
2331 // buffer-local option set | 2331 // buffer-local option set |
2332 free_callback(&curbuf->b_tsrfu_cb); | |
2333 retval = option_set_callback_func(curbuf->b_p_tsrfu, | 2332 retval = option_set_callback_func(curbuf->b_p_tsrfu, |
2334 &curbuf->b_tsrfu_cb); | 2333 &curbuf->b_tsrfu_cb); |
2335 } | 2334 } |
2336 else | 2335 else |
2337 { | 2336 { |
2338 // global option set | 2337 // global option set |
2339 free_callback(&tsrfu_cb); | |
2340 retval = option_set_callback_func(p_tsrfu, &tsrfu_cb); | 2338 retval = option_set_callback_func(p_tsrfu, &tsrfu_cb); |
2341 } | 2339 } |
2342 | 2340 |
2343 return retval; | 2341 return retval; |
2344 } | 2342 } |