Code

perl plugin: Fixed a segfault that appeared in Perl 5.10.
authorSebastian Harl <sh@tokkee.org>
Thu, 29 May 2008 22:12:36 +0000 (00:12 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 3 Jun 2008 14:31:18 +0000 (16:31 +0200)
In Perl 5.10, av_clear() (amongst others) does no longer allow NULL for
the passed array object pointer, thus we have to check for it ourselves.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/perl.c

index 9bd3b4d200d255d242cdf2d1694a92b631ca3202..2bd03afdb0bee45d02170b105ee74b4766ceb688 100644 (file)
@@ -1118,7 +1118,7 @@ static c_ithread_t *c_ithread_create (PerlInterpreter *base)
 
        aTHX = t->interp;
 
-       if (NULL != base) {
+       if ((NULL != base) && (NULL != PL_endav)) {
                av_clear (PL_endav);
                av_undef (PL_endav);
                PL_endav = Nullav;