Fix execute's printing of the executed commands

If execute's argument was read interactively, it prints the argument
instead of the command.  Else, it prints uninitialized garbage.  The
latter can theoretically crash the server, or leak information.

Broken in commit 3de1e8be, v4.3.28
This commit is contained in:
Markus Armbruster 2012-03-15 21:38:29 +01:00
parent 68dc9b2936
commit 8b7c78b5fa

View file

@ -254,12 +254,12 @@ execute(void)
continue;
}
pr("\nExecute : ");
uprnf(buf);
uprnf(player->combuf);
pr("\n");
if (redir) {
pr("Execute : redirection not supported\n");
failed = 1;
} else if (dispatch(buf, NULL) < 0)
} else if (dispatch(player->combuf, NULL) < 0)
failed = 1;
empth_yield();
}