# HG changeset patch # User Sadrul Habib Chowdhury # Date 1242498835 0 # Node ID 22b87a82755bdf0e11ecf5507388b3600e0bd0d5 # Parent 7c58f6f50f160e05ebfab72651839cdeac29441c Fix a couple of crashes in the perl plugin loader. * Do NULL check before using strcmp. The NULL could be set by either libpurple, or the plugin. * Looks like we need to PERL_SET_CONTEXT to setup the perl environment correctly. diff -r 7c58f6f50f16 -r 22b87a82755b libpurple/plugins/perl/perl-handlers.c --- a/libpurple/plugins/perl/perl-handlers.c Sat May 16 17:11:50 2009 +0000 +++ b/libpurple/plugins/perl/perl-handlers.c Sat May 16 18:33:55 2009 +0000 @@ -284,6 +284,8 @@ DATATYPE **copy_args; dSP; + PERL_SET_CONTEXT(my_perl); + SPAGAIN; ENTER; SAVETMPS; PUSHMARK(sp); @@ -364,7 +366,8 @@ break; case PURPLE_TYPE_STRING: - if (strcmp(*((char **)copy_args[i]), SvPVX(sv_args[i]))) { + if (!*((char **)copy_args[i]) || !SvPVX(sv_args[i]) || + strcmp(*((char **)copy_args[i]), SvPVX(sv_args[i]))) { g_free(*((char **)copy_args[i])); *((char **)copy_args[i]) = g_strdup(SvPVutf8_nolen(sv_args[i]));