From 4e64bc7883e56746abe50f0abba9ceb0186ec35c Mon Sep 17 00:00:00 2001 From: Mark <> Date: Thu, 4 Mar 2004 19:46:53 +0000 Subject: [PATCH] liquid update --- ChangeLog | 1 + ircstring.c | 6 +++++- liquidircd.c | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ade7a8a..7248d0ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -79,6 +79,7 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant - Add Unreal EOS support for server synchs (M) - Add Berkeley support for statserv (M) - Add basic support for module side auth to use within SecureServ (M) + - Fix for bug 117 (Buffer overflow) (M) * NeoStats * Fish (F) * Version 2.5.14 - Fix a bug with HostServ unable to load the database diff --git a/ircstring.c b/ircstring.c index 55c7c33a..2eecd470 100644 --- a/ircstring.c +++ b/ircstring.c @@ -131,7 +131,11 @@ int ircvsnprintf(char *buf, size_t size, const char *fmt, va_list args) } } /* NULL terminate */ - buf[len] = 0; + if(len < size) { + buf[len] = 0; + } else { + buf[size -1] = 0; + } /* return count chars written */ return len; #endif diff --git a/liquidircd.c b/liquidircd.c index ea663e10..1da2bcb5 100644 --- a/liquidircd.c +++ b/liquidircd.c @@ -295,16 +295,23 @@ send_invite (const char *from, const char *to, const char *chan) void send_akill (const char *sender, const char *host, const char *ident, const char *setby, const int length, const char *reason, const unsigned long ts) { +#if 0 send_cmd (":%s %s %s %s %d %s %lu :%s", sender, MSG_AKILL, host, ident, length, setby, ts, reason); +#else + send_cmd (":%s %s add %s@%s %d %d %s :%s", me.name, MSG_GLINE, ident, host, length, (int)me.now, setby, reason); +#endif } void send_rakill (const char *sender, const char *host, const char *ident) { +#if 0 send_cmd (":%s %s %s %s", sender, MSG_RAKILL, host, ident); +#else + send_cmd (":%s %s del %s@%s", me.name, MSG_GLINE, ident, host); +#endif } - void send_svinfo (const int tscurrent, const int tsmin, const unsigned long tsnow) {