From aebfd31373b7bb551f03b31d8e9f2edfbb45d49f Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 5 Jun 2012 00:30:22 +0000 Subject: don't crash if add_history is called from an empty line. Called from nslookup in new bind. XXX: pullup to 6 --- lib/libedit/readline.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libedit') diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c index ddb3840029c..67beaaf5ef6 100644 --- a/lib/libedit/readline.c +++ b/lib/libedit/readline.c @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.103 2012/05/15 19:07:25 christos Exp $ */ +/* $NetBSD: readline.c,v 1.104 2012/06/05 00:30:22 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.103 2012/05/15 19:07:25 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.104 2012/06/05 00:30:22 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -1372,6 +1372,9 @@ add_history(const char *line) { HistEvent ev; + if (line == NULL) + return 0; + if (h == NULL || e == NULL) rl_initialize(); -- cgit