]> git.pond.sub.org Git - empserver/commitdiff
(show_motd): Printed motd with pr(), as a printf()-like format string!
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Aug 2004 05:52:58 +0000 (05:52 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Aug 2004 05:52:58 +0000 (05:52 +0000)
This reads and formats junk from the stack when motd contains '%', and
can even crash.  Use prnf() instead.

src/lib/player/player.c

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