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)
This commit is contained in:
parent
1ec3e374fb
commit
2fca78e125
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user