From: simon Date: Tue, 20 Jan 2009 18:40:07 +0000 (+0000) Subject: Prevent obvious NULL dereference if you paste before cutting or copying. X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/tweak/commitdiff_plain/d38a0ee851c3aadef1348cfb9c8c4673bd883119 Prevent obvious NULL dereference if you paste before cutting or copying. git-svn-id: svn://svn.tartarus.org/sgt/tweak@8423 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/actions.c b/actions.c index a6d96bd..fb71b9f 100644 --- a/actions.c +++ b/actions.c @@ -462,6 +462,8 @@ static void act_copy (void) { static void act_paste (void) { fileoffset_t cutsize, new_top; + if (!cutbuffer) + return; cutsize = buf_length (cutbuffer); if (!insert_mode) { if (cur_pos + cutsize > file_size) {