]> git.pond.sub.org Git - empserver/commitdiff
Fix execute's printing of the executed commands
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 15 Mar 2012 20:38:29 +0000 (21:38 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 15 Mar 2012 20:38:29 +0000 (21:38 +0100)
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

src/lib/player/player.c

index 35b1ca09179e33c58998c373d967c6062aac298b..2a489392d4f482f09f0794eb3b44a76e72f2e1ef 100644 (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();
     }