From dcbeefcd23b8b54de7b2ae16fbf1af39ab91e480 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Thu, 8 Jun 2017 15:05:07 +1000 Subject: 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 } --- src/nvim/ops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index c5660f68fd..496d757106 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -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); } -- cgit