summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-08-01 13:58:04 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-08-01 13:58:04 +0000
commitb8ffc8df1a4e893e9c7d77b64a6fae8af5801974 (patch)
tree664b3279897c4f1ff6dafd1f0bcd75de34f68ed1 /mg.c
parent4d0523d6c78866412e93a18e8d5034cac4b49d90 (diff)
downloadperl-b8ffc8df1a4e893e9c7d77b64a6fae8af5801974.tar.gz
Various patches by John E. Malmberg to fix data
corruption issues on VMS. Back out change 25218 and the parts of change 25217 that affect pp_ctl.c and pp_sys.c. p4raw-id: //depot/perl@25257
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index e3d66bee72..628afa0b21 100644
--- a/mg.c
+++ b/mg.c
@@ -1045,10 +1045,13 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
MgTAINTEDDIR_off(mg);
#ifdef VMS
if (s && klen == 8 && strEQ(ptr, "DCL$PATH")) {
- char pathbuf[256], eltbuf[256], *cp, *elt = (char *) s;
+ char pathbuf[256], eltbuf[256], *cp, *elt;
Stat_t sbuf;
int i = 0, j = 0;
+ strncpy(eltbuf, s, 255);
+ eltbuf[255] = 0;
+ elt = eltbuf;
do { /* DCL$PATH may be a search list */
while (1) { /* as may dev portion of any element */
if ( ((cp = strchr(elt,'[')) || (cp = strchr(elt,'<'))) ) {