1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00:00

fix use after free in expando error

This commit is contained in:
ailin-nemui 2016-08-12 18:24:58 +02:00
parent 61fa6eb35b
commit b411f943a0

View File

@ -74,15 +74,18 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
ret = NULL;
if (SvTRUE(ERRSV)) {
PERL_SCRIPT_REC *script = rec->script;
(void) POPs;
/* call putback before emitting script error signal as that
* could manipulate the perl stack. */
PUTBACK;
/* make sure we don't get back here */
if (rec->script != NULL)
script_unregister_expandos(rec->script);
if (script != NULL)
script_unregister_expandos(script);
/* rec has been freed now */
signal_emit("script error", 2, rec->script, SvPV_nolen(ERRSV));
signal_emit("script error", 2, script, SvPV_nolen(ERRSV));
} else if (retcount > 0) {
ret = g_strdup(POPp);
*free_ret = TRUE;