(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:
parent
40c88d77d8
commit
60541ccfaf
1 changed files with 2 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue