Fixed possible null pointer dereference #392.
authorDaniel Carl <danielcarl@gmx.de>
Thu, 11 May 2017 12:50:01 +0000 (14:50 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Thu, 11 May 2017 12:51:24 +0000 (14:51 +0200)
src/ex.c

index fde1bb7..3660ec7 100644 (file)
--- a/src/ex.c
+++ b/src/ex.c
@@ -1324,6 +1324,10 @@ static gboolean history(Client *c, gboolean prev)
         exhist.active = new;
     }
 
+    if (!exhist.active) {
+        goto failed;
+    }
+
     vb_echo_force(c, MSG_NORMAL, FALSE, "%s%s", exhist.prefix, (char*)exhist.active->data);
 
     g_free(input);