mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
Avoid crash if get_oper_name() somehow gave no {} for local oper.
This commit is contained in:
parent
5c2b9eaf48
commit
ee6da53d74
1 changed files with 2 additions and 1 deletions
|
@ -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] = '}';
|
||||
|
|
Loading…
Reference in a new issue