From ee6da53d74df6c4e1bc354df88b1d05c3fbc2015 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 6 Mar 2010 16:37:50 +0100 Subject: [PATCH] Avoid crash if get_oper_name() somehow gave no {} for local oper. --- src/s_serv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s_serv.c b/src/s_serv.c index 32367cf5..90f2c6c2 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -430,7 +430,8 @@ burst_ban(struct Client *client_p) */ rb_strlcpy(operbuf, aconf->info.oper, sizeof buf); p = strrchr(operbuf, '{'); - if (operbuf + sizeof operbuf - p > (ptrdiff_t)(melen + 2)) + if (p != NULL && + operbuf + sizeof operbuf - p > (ptrdiff_t)(melen + 2)) { memcpy(p + 1, me.name, melen); p[melen + 1] = '}';