Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit don't crash if add_history is called from an emp...



details:   https://anonhg.NetBSD.org/src/rev/cf03810a756c
branches:  trunk
changeset: 779600:cf03810a756c
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 05 00:30:22 2012 +0000

description:
don't crash if add_history is called from an empty line. Called from
nslookup in new bind.
XXX: pullup to 6

diffstat:

 lib/libedit/readline.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 57bbbfd26687 -r cf03810a756c lib/libedit/readline.c
--- a/lib/libedit/readline.c    Mon Jun 04 22:45:05 2012 +0000
+++ b/lib/libedit/readline.c    Tue Jun 05 00:30:22 2012 +0000
@@ -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 <sys/types.h>
@@ -1372,6 +1372,9 @@
 {
        HistEvent ev;
 
+       if (line == NULL)
+               return 0;
+
        if (h == NULL || e == NULL)
                rl_initialize();
 



Home | Main Index | Thread Index | Old Index