(flash, wall): Long arguments could smash the stack; fix insufficient

buffers.  Closes #940792.

(wall): Don't strip first word from message.  Closes #940790.
This commit is contained in:
Markus Armbruster 2004-04-25 13:09:41 +00:00
parent 40c88d77d8
commit 60541ccfaf

View file

@ -44,7 +44,7 @@ flash(void)
{
struct natstr *us;
struct natstr *to;
s_char buf[600];
s_char buf[1024];
int tocn;
s_char *sp;
@ -94,13 +94,12 @@ int
wall(void)
{
struct natstr *us;
s_char buf[600];
s_char buf[1024];
s_char *sp;
us = getnatp(player->cnum);
if (player->argp[1]) {
for (sp = &player->combuf[0]; *sp && *sp != ' '; ++sp) ;
for (++sp; *sp && *sp != ' '; ++sp) ;
sprintf(buf, ":%s", sp);
sendmessage(us, 0, buf, 1);
} else {