(show_motd): Printed motd with pr(), as a printf()-like format string!

This reads and formats junk from the stack when motd contains '%', and
can even crash.  Use prnf() instead.
This commit is contained in:
Markus Armbruster 2004-08-10 05:52:58 +00:00
parent 743be658c8
commit d721ba3b5c

View file

@ -366,7 +366,7 @@ show_motd(void)
if (tgm.tel_length >= (long)sizeof(buf)) if (tgm.tel_length >= (long)sizeof(buf))
tgm.tel_length = sizeof(buf) - 1; tgm.tel_length = sizeof(buf) - 1;
buf[tgm.tel_length] = 0; buf[tgm.tel_length] = 0;
pr(buf); prnf(buf);
(void)close(upf); (void)close(upf);
return RET_OK; return RET_OK;
} }