]> skyeroc.xyz Git - dgamelaunch/commitdiff
Virus: Fix dot command segfault
authorPasi Kallinen <paxed@alt.org>
Sat, 15 Dec 2012 17:42:54 +0000 (19:42 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 15 Dec 2012 17:42:54 +0000 (19:42 +0200)
virus.c

diff --git a/virus.c b/virus.c
index f96c5d4f4a2a1720342c495bafc6545096beab65..1613d4d17ee4c1bb7f3ef5b466cf3c5ac5994c7f 100644 (file)
--- a/virus.c
+++ b/virus.c
@@ -2647,7 +2647,7 @@ static Byte *char_insert(Byte * p, Byte c)  // insert the char c at 'p'
           p = text_hole_delete (p, p);  // shrink buffer 1 char
 #ifdef BB_FEATURE_VI_DOT_CMD
           // also rmove char from last_modifying_cmd
-          if (strlen((char *) last_modifying_cmd) > 0) {
+          if (last_modifying_cmd && (strlen((char *) last_modifying_cmd) > 0)) {
               Byte *q;
 
               q = last_modifying_cmd;