mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
clang/'Logic error': fix loop cond to avoid nullptr deref
nvim_set_decoration_provider() has insufficient null checks.
This commit is contained in:
@@ -2960,7 +2960,7 @@ void nvim_set_decoration_provider(Integer ns_id, DictionaryOf(LuaRef) opts,
|
|||||||
String k = opts.items[i].key;
|
String k = opts.items[i].key;
|
||||||
Object *v = &opts.items[i].value;
|
Object *v = &opts.items[i].value;
|
||||||
size_t j;
|
size_t j;
|
||||||
for (j = 0; cbs[j].name; j++) {
|
for (j = 0; cbs[j].name && cbs[j].dest; j++) {
|
||||||
if (strequal(cbs[j].name, k.data)) {
|
if (strequal(cbs[j].name, k.data)) {
|
||||||
if (v->type != kObjectTypeLuaRef) {
|
if (v->type != kObjectTypeLuaRef) {
|
||||||
api_set_error(err, kErrorTypeValidation,
|
api_set_error(err, kErrorTypeValidation,
|
||||||
|
Reference in New Issue
Block a user