aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Hall <followingthepath@gmail.com>2017-06-08 15:05:07 +1000
committerChris Hall <followingthepath@gmail.com>2017-06-20 14:47:12 +1000
commitdcbeefcd23b8b54de7b2ae16fbf1af39ab91e480 (patch)
treeff91359e53664cbed9dc5d9a70f4c2e72d85ab53
parent76ea97c809e50fccc5ca6615943ac6da1db1e030 (diff)
downloadrneovim-dcbeefcd23b8b54de7b2ae16fbf1af39ab91e480.tar.gz
rneovim-dcbeefcd23b8b54de7b2ae16fbf1af39ab91e480.tar.bz2
rneovim-dcbeefcd23b8b54de7b2ae16fbf1af39ab91e480.zip
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 }
-rw-r--r--src/nvim/ops.c4
1 files changed, 4 insertions, 0 deletions
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);
}