From f2c9961a21ad56cc5f6440e2dd661a588188c149 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 16 Dec 2010 14:27:16 +0100 Subject: Fix crash in perl plugin when MULTIPLICITY is disabled --- ChangeLog | 3 ++- src/plugins/scripts/perl/weechat-perl.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index af385c0ff..c080f1c4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.4-rc1, 2010-12-15 +v0.3.4-rc1, 2010-12-16 Version 0.3.4 (under dev!) @@ -194,6 +194,7 @@ Version 0.3.2 (2010-04-18) * alias: add custom completion for aliases (task #9479) * scripts: allow script commands to reload only one script * scripts: fix bug with callbacks when loading a script already loaded +* perl: fix crash when MULTIPLICITY is disabled * perl: fix crash when callbacks are called during script initialization (bug #29018) * perl: fix crash on /quit or unload of plugin under FreeBSD and Cygwin diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 73693d2b4..3b0ea5f37 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -275,11 +275,14 @@ weechat_perl_exec (struct t_plugin_script *script, if (script->interpreter) PERL_SET_CONTEXT (script->interpreter); #else - length = strlen (script->interpreter) + strlen (function) + 3; + length = strlen ((script->interpreter) ? script->interpreter : perl_main) + + strlen (function) + 3; func = (char *) malloc (length); if (!func) return NULL; - snprintf (func, length, "%s::%s", (char *) script->interpreter, function); + snprintf (func, length, "%s::%s", + (char *) ((script->interpreter) ? script->interpreter : perl_main), + function); #endif ENTER; -- cgit v1.2.3