mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/112076: fixing "Explicit null dereferenced"
if (oap->regname == 0 && oap->motion_type != kMTLineWise && oap->line_count == 0 && !oap->use_reg_one ){ then reg is not initialised and our call to set_clipboard will dereference NULL }
This commit is contained in:
parent
76ea97c809
commit
dcbeefcd23
@ -1408,6 +1408,10 @@ int op_delete(oparg_T *oap)
|
||||
}
|
||||
|
||||
if (oap->regname == 0) {
|
||||
if (reg == NULL) {
|
||||
// Guard against NULL reg
|
||||
abort();
|
||||
}
|
||||
set_clipboard(0, reg);
|
||||
do_autocmd_textyankpost(oap, reg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user