diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2025-06-13 14:19:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-13 05:19:30 -0700 |
| commit | 3e303231350eff7c8326f9e04dbbb0177b188258 (patch) | |
| tree | b360c170dfbfb4ae14ba6c204ddda38b7d2e9e9b /runtime/lua/vim/_extui/shared.lua | |
| parent | 29c8dabd414cca6fe0bad41b585b42f27559a810 (diff) | |
fix(coverity/554963): preallocate msg.items to avoid FORWARD_NULL #34484
*** CID 554963: (FORWARD_NULL)
/src/nvim/memline.c: 3484 in findswapname()
3478 if (swap_exists_action != SEA_NONE) {
3479 kv_printf(msg, _("Swap file \""));
3480 kv_printf(msg, "%s", fhname);
3481 kv_printf(msg, _("\" already exists!"));
3482 char *run_but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort");
3483 char *but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort");
>>> CID 554963: (FORWARD_NULL)
>>> Passing null pointer "msg.items" to "do_dialog", which dereferences it.
3484 choice = (sea_choice_T)do_dialog(VIM_WARNING, _("VIM - ATTENTION"), msg.items,
3485 proc_running ? run_but : but, 1, NULL, false);
3486
3487 // compensate for missing "Delete it" button
3488 choice += proc_running && choice >= 4;
3489 // pretend screen didn't scroll, need redraw anyway
/src/nvim/memline.c: 3492 in findswapname()
3486
3487 // compensate for missing "Delete it" button
3488 choice += proc_running && choice >= 4;
3489 // pretend screen didn't scroll, need redraw anyway
3490 msg_reset_scroll();
3491 } else {
>>> CID 554963: (FORWARD_NULL)
>>> Passing null pointer "msg.items" to "msg_outtrans", which dereferences it.
3492 msg_outtrans(msg.items, 0, false);
3493 }
3494 no_wait_return--;
3495 kv_destroy(msg);
3496 xfree(fhname);
3497 }
Diffstat (limited to 'runtime/lua/vim/_extui/shared.lua')
0 files changed, 0 insertions, 0 deletions
