Avoid crash if get_oper_name() somehow gave no {} for local oper.

This commit is contained in:
Jilles Tjoelker 2010-03-06 16:37:50 +01:00
parent 5c2b9eaf48
commit ee6da53d74

View file

@ -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] = '}';