diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-09-25 12:50:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-25 12:50:13 -0400 |
| commit | 585957c6ef0a0e322ce2d3518f72e010061b3ffe (patch) | |
| tree | 8663a0bd284532a02bcb73bd9228934b0b8253d8 /runtime/lua/vim/provider/python.lua | |
| parent | ff0b9f94331b1b8b68a30e05a22b53637b903af5 (diff) | |
| download | rneovim-585957c6ef0a0e322ce2d3518f72e010061b3ffe.tar.gz rneovim-585957c6ef0a0e322ce2d3518f72e010061b3ffe.tar.bz2 rneovim-585957c6ef0a0e322ce2d3518f72e010061b3ffe.zip | |
fix(coverity): kv_ensure_space overflow #42091
Problem:
gcc and Coverity report potential `size + len `overflow kv_concat_len().
CID 656305: Null pointer dereferences (FORWARD_NULL)
/src/nvim/input_cmdatom.c: 474 in atom_push_raw()
468 atom_captures++;
469 }
470 if (collect) {
471 composite.queued = true;
472 }
473 kv_push(vatom.atoms, *atom);
>>> CID 656305: Null pointer dereferences (FORWARD_NULL)
>>> Dereferencing null pointer "cur_frame".
474 vatom.frame = cur_frame->id;
475 return;
476 }
477 atom_captures++;
478 if (atom->type == kAVisual && kv_size(atom->atoms) > 0) {
479 // The completing operator is the only subatom that could have edited.
CID 656304: Memory - illegal accesses (OVERRUN)
/src/nvim/input.c: 718 in sb_add_spec()
712 /// bytes. Unlike sb_add_lit(), no CTRL-V: for text read raw (<Cmd>), not typed into a cmdline.
713 void sb_add_spec(StringBuilder *buf, const char *s)
714 {
715 while (*s != NUL) {
716 if ((uint8_t)(*s) == K_SPECIAL && s[1] != NUL && s[2] != NUL) {
717 // Insert special key literally.
>>> CID 656304: Memory - illegal accesses (OVERRUN)
>>> Overrunning dynamic array "buf->items" at offset corresponding to index variable "buf->size" through dereference in call to "memcpy".
718 kv_concat_len(*buf, s, 3);
719 s += 3;
720 } else {
721 sb_add_char(buf, mb_cptr2char_adv(&s));
722 }
723 }
Solution:
Both are false positives; assert or check to avoid the warnings.
Diffstat (limited to 'runtime/lua/vim/provider/python.lua')
0 files changed, 0 insertions, 0 deletions