diff options
author | delphij <delphij@FreeBSD.org> | 2013-09-25 20:37:16 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2013-09-25 20:37:16 +0000 |
commit | 2fca78e125311d5ffee83d40488c276c68389546 (patch) | |
tree | 1fa0967d606fb5f1d95fbfdad00dccbf0b48456e /contrib/bind9/bin | |
parent | 1ec3e374fb372ff7b1a6e5008404e8fa4d1fe765 (diff) | |
download | FreeBSD-src-2fca78e125311d5ffee83d40488c276c68389546.zip FreeBSD-src-2fca78e125311d5ffee83d40488c276c68389546.tar.gz |
Correct a NULL pointer deference in nslookup and nsupdate that would
cause the utility to crash in interactive mode when the user gives
an EOF on standard input.
MFC after: 3 days
Approved by: re (gjb)
Diffstat (limited to 'contrib/bind9/bin')
-rw-r--r-- | contrib/bind9/bin/dig/nslookup.c | 3 | ||||
-rw-r--r-- | contrib/bind9/bin/nsupdate/nsupdate.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/contrib/bind9/bin/dig/nslookup.c b/contrib/bind9/bin/dig/nslookup.c index 3f5b82f..6864716 100644 --- a/contrib/bind9/bin/dig/nslookup.c +++ b/contrib/bind9/bin/dig/nslookup.c @@ -767,7 +767,8 @@ get_next_command(void) { if (interactive) { #ifdef HAVE_READLINE ptr = readline("> "); - add_history(ptr); + if (ptr != NULL && *ptr != '\0') + add_history(ptr); #else fputs("> ", stderr); fflush(stderr); diff --git a/contrib/bind9/bin/nsupdate/nsupdate.c b/contrib/bind9/bin/nsupdate/nsupdate.c index e96c075..06e5fc1 100644 --- a/contrib/bind9/bin/nsupdate/nsupdate.c +++ b/contrib/bind9/bin/nsupdate/nsupdate.c @@ -2008,7 +2008,8 @@ get_next_command(void) { if (interactive) { #ifdef HAVE_READLINE cmdline = readline("> "); - add_history(cmdline); + if (cmdline != NULL && *cmdline != '\0') + add_history(cmdline); #else fprintf(stdout, "> "); fflush(stdout); |