1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Don't try to use the PERL_SIGNAL_REC after it could be freed

This commit is contained in:
aquanight 2020-07-05 16:09:19 -06:00
parent 7daeaa25b6
commit 2d59df8162

View File

@ -414,16 +414,18 @@ static void sig_func(const void *p1, const void *p2,
const void *p5, const void *p6) const void *p5, const void *p6)
{ {
PERL_SIGNAL_REC *rec; PERL_SIGNAL_REC *rec;
PERL_SCRIPT_REC *script;
const void *args[SIGNAL_MAX_ARGUMENTS]; const void *args[SIGNAL_MAX_ARGUMENTS];
args[0] = p1; args[1] = p2; args[2] = p3; args[0] = p1; args[1] = p2; args[2] = p3;
args[3] = p4; args[4] = p5; args[5] = p6; args[3] = p4; args[4] = p5; args[5] = p6;
rec = signal_get_user_data(); rec = signal_get_user_data();
script = rec->script;
if (rec->script->unloaded) return; /* Drop signal calls into unloaded scripts. */ if (rec->script->unloaded) return; /* Drop signal calls into unloaded scripts. */
perl_script_enter(rec->script); perl_script_enter(script);
perl_call_signal(rec->script, rec->func, signal_get_emitted_id(), args); perl_call_signal(script, rec->func, signal_get_emitted_id(), args);
perl_script_exit(rec->script); perl_script_exit(script);
} }
static void perl_signal_add_full_int(const char *signal, SV *func, static void perl_signal_add_full_int(const char *signal, SV *func,