summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/perl/weechat-perl-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-04-30 13:21:21 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-04-30 13:21:21 +0200
commit886b81498f2b0e738c16ec55d4675f3c8555117d (patch)
tree5faa27240b105ce0c0f67c4a40fc1ee17fc40cfe /src/plugins/scripts/perl/weechat-perl-api.c
parent760e216c5b3cc7945bfb17f94e39900d20c185e7 (diff)
downloadweechat-886b81498f2b0e738c16ec55d4675f3c8555117d.zip
Fixed crash with scripts when WeeChat calls functions of many scripts at same time with callbacks (bug #23109)
Diffstat (limited to 'src/plugins/scripts/perl/weechat-perl-api.c')
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index 51698344a..082363983 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -2192,7 +2192,7 @@ weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
{
struct t_script_callback *script_callback;
char *perl_argv[3];
- static char value_str[64];
+ static char value_str[64], empty_value[1] = { '\0' };
int *rc, ret, free_needed;
script_callback = (struct t_script_callback *)data;
@@ -2201,7 +2201,7 @@ weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
- perl_argv[1] = (char *)signal_data;
+ perl_argv[1] = (signal_data) ? (char *)signal_data : empty_value;
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{