The internal routine that converts VMS filespecs to unix filespecs
allocates less space than it should for the resulting filespec under
certain (apparently rare) conditions, specifically when the device name
is defaulted from the current environment. So, for example when
converting [bar] to /foo/bar/ (because the current directory is on a
device named foo), only 8 bytes including the trailing null are
allocated, but 10 are necessary.
The attached patch fixes the problem and is against bleadperl but should
be propagated to maint as soon as convenient.
--- vms/vms.c_orig Thu Dec 11 18:13:10 2003
+++ vms/vms.c Sat Mar 20 15:16:36 2004
@@ -3635,7 +3635,8 @@
{
static char __tounixspec_retbuf[NAM$C_MAXRSS+1];
char *dirend, *rslt, *cp1, *cp2, *cp3, tmp[NAM$C_MAXRSS+1];
- int devlen, dirlen, retlen = NAM$C_MAXRSS+1, expand = 0;
+ int devlen, dirlen, retlen = NAM$C_MAXRSS+1;
+ int expand = 1; /* guarantee room for leading and trailing slashes */
unsigned short int trnlnm_iter_count;
if (spec == NULL) return NULL;