diff options
author | Craig A. Berry <craigberry@mac.com> | 2013-11-24 18:27:00 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2013-11-24 18:27:00 -0600 |
commit | f420cce1268f3055e24f052a6b2c0afbbfea7624 (patch) | |
tree | 22ef1b2b22f00497455f386059ecbe950c635077 /perl.c | |
parent | 106793b61fcb516b154e40608eef7ef29caa9590 (diff) | |
download | perl-f420cce1268f3055e24f052a6b2c0afbbfea7624.tar.gz |
Fix VMS-specific wraparound error in S_mayberelocate.
In trimming the trailing slash from a Unix path spec, we haven't
(since 5.003 or so) been ensuring that we weren't stepping off
the beginning of the string. No, it's not normal to have '/' as
a library path, but if it happens we shouldn't allow a zero or
negative (actually wraparound since unsigned) value for the path
length.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4529,7 +4529,7 @@ S_mayberelocate(pTHX_ const char *const dir, STRLEN len, U32 flags) if ((unix = tounixspec_ts(SvPV(libdir,len),NULL)) != NULL) { len = strlen(unix); - while (unix[len-1] == '/') len--; /* Cosmetic */ + while (len > 1 && unix[len-1] == '/') len--; /* Cosmetic */ sv_usepvn(libdir,unix,len); } else |