1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 01:13:13 +02:00

Fix crash on +f modes merging (SJOIN) due to the 6.1.0 +f/+F changes.

Reported by Valware.
This commit is contained in:
Bram Matthys
2023-04-05 07:21:52 +02:00
parent c5a763de06
commit e8aef70f03
+8 -2
View File
@@ -942,8 +942,14 @@ void *cmodef_dup_struct(void *r_in)
/* We can copy most members in a lazy way... */
memcpy(w, r, sizeof(ChannelFloodProtection));
/* ... except this one. */
w->profile = raw_strdup(r->profile);
/* ... except this one.
* NOTE: can't use safe_strdup() here because
* w->profile = r->profile at this point due
* to the memcpy and safe_strdup() would free
* it (and thus both).
*/
if (r->profile)
w->profile = raw_strdup(r->profile);
return (void *)w;
}