Mercurial > vim
comparison src/option.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 | 65ab0b035dd8 |
children | 919ee902079a |
comparison
equal
deleted
inserted
replaced
26451:27720705109b | 26452:65b4109a4297 |
---|---|
7208 tv = alloc_string_tv(vim_strsave(optval)); | 7208 tv = alloc_string_tv(vim_strsave(optval)); |
7209 if (tv == NULL) | 7209 if (tv == NULL) |
7210 return FAIL; | 7210 return FAIL; |
7211 | 7211 |
7212 cb = get_callback(tv); | 7212 cb = get_callback(tv); |
7213 if (cb.cb_name == NULL) | 7213 if (cb.cb_name == NULL || *cb.cb_name == NUL) |
7214 { | 7214 { |
7215 free_tv(tv); | 7215 free_tv(tv); |
7216 return FAIL; | 7216 return FAIL; |
7217 } | 7217 } |
7218 | 7218 |