In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/bac5c4fca5109adea821c05bef9182e2dac95c81?hp=3607ca02d65ff63a9322effaf09e60361984e109>
- Log ----------------------------------------------------------------- commit bac5c4fca5109adea821c05bef9182e2dac95c81 Author: Jan Dubois <[email protected]> Date: Tue Apr 3 17:15:59 2012 -0700 SITELIB_EXP may be NULL on Windows The sitelib directory is located dynamically at runtime by checking for the ../site path relative to the location of perl5xx.dll. This directory doesn't exist at buildtime, so calling strlen(NULL) may cause an access violation... ----------------------------------------------------------------------- Summary of changes: perl.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/perl.c b/perl.c index 5657432..7f6848e 100644 --- a/perl.c +++ b/perl.c @@ -2034,17 +2034,19 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) # else /* SITELIB_EXP is a function call on Win32. */ const char *const raw_sitelib = SITELIB_EXP; - /* process .../.. if PERL_RELOCATABLE_INC is defined */ - SV *sitelib_sv = mayberelocate(raw_sitelib, strlen(raw_sitelib), - INCPUSH_CAN_RELOCATE); - const char *const sitelib = SvPVX(sitelib_sv); - (void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav, - Perl_newSVpvf(aTHX_ - "BEGIN { do {local $!; -f q%c%s/sitecustomize.pl%c} && do q%c%s/sitecustomize.pl%c }", - 0, sitelib, 0, - 0, sitelib, 0)); - assert (SvREFCNT(sitelib_sv) == 1); - SvREFCNT_dec(sitelib_sv); + if (raw_sitelib) { + /* process .../.. if PERL_RELOCATABLE_INC is defined */ + SV *sitelib_sv = mayberelocate(raw_sitelib, strlen(raw_sitelib), + INCPUSH_CAN_RELOCATE); + const char *const sitelib = SvPVX(sitelib_sv); + (void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav, + Perl_newSVpvf(aTHX_ + "BEGIN { do {local $!; -f q%c%s/sitecustomize.pl%c} && do q%c%s/sitecustomize.pl%c }", + 0, sitelib, 0, + 0, sitelib, 0)); + assert (SvREFCNT(sitelib_sv) == 1); + SvREFCNT_dec(sitelib_sv); + } # endif } #endif -- Perl5 Master Repository
