Browse files

Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL).

MFC after:	3 days
Approved by:	re (gjb)
  • Loading branch information...
1 parent 128d499 commit 74e37edc359b62afa8e78e3d26bce859b1a409d7 @delphij delphij committed Sep 26, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/libedit/readline.c
View
3 lib/libedit/readline.c
@@ -1363,6 +1363,9 @@ add_history(const char *line)
TYPE(HistEvent) ev;
const Char *wline;
+ if (line == NULL)
+ return 0;
+
if (h == NULL || e == NULL)
rl_initialize();

0 comments on commit 74e37ed

Please sign in to comment.