Prevent obvious NULL dereference if you paste before cutting or copying.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jan 2009 18:40:07 +0000 (18:40 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jan 2009 18:40:07 +0000 (18:40 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/tweak@8423 cda61777-01e9-0310-a592-d414129be87e

actions.c

index a6d96bd..fb71b9f 100644 (file)
--- 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) {