svn commit: r255873 - in head/contrib/bind9/bin: dig nsupdate

Xin LI delphij at FreeBSD.org
Wed Sep 25 20:37:17 UTC 2013


Author: delphij
Date: Wed Sep 25 20:37:16 2013
New Revision: 255873
URL: http://svnweb.freebsd.org/changeset/base/255873

Log:
  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)

Modified:
  head/contrib/bind9/bin/dig/nslookup.c
  head/contrib/bind9/bin/nsupdate/nsupdate.c

Modified: head/contrib/bind9/bin/dig/nslookup.c
==============================================================================
--- head/contrib/bind9/bin/dig/nslookup.c	Wed Sep 25 20:06:01 2013	(r255872)
+++ head/contrib/bind9/bin/dig/nslookup.c	Wed Sep 25 20:37:16 2013	(r255873)
@@ -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);

Modified: head/contrib/bind9/bin/nsupdate/nsupdate.c
==============================================================================
--- head/contrib/bind9/bin/nsupdate/nsupdate.c	Wed Sep 25 20:06:01 2013	(r255872)
+++ head/contrib/bind9/bin/nsupdate/nsupdate.c	Wed Sep 25 20:37:16 2013	(r255873)
@@ -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);


More information about the svn-src-all mailing list