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 70fd7fc9fb
commit c3666dd012
1 changed files with 2 additions and 1 deletions

View File

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