From: Jilles Tjoelker Date: Sat, 6 Mar 2010 15:37:50 +0000 (+0100) Subject: Avoid crash if get_oper_name() somehow gave no {} for local oper. X-Git-Url: https://jfr.im/git/solanum.git/commitdiff_plain/ee6da53d74df6c4e1bc354df88b1d05c3fbc2015 Avoid crash if get_oper_name() somehow gave no {} for local oper. --- 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] = '}';