diff options
author | Craig A. Berry <craigberry@mac.com> | 2007-12-10 05:45:22 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-12-10 05:45:22 +0000 |
commit | c43a0d1c08263915bcac804cc40b350d03a1b68f (patch) | |
tree | f36a596616d51de16954b56d7a8641f879cc235e /vms | |
parent | 7c884029b172785f91952c288d2d0025cb0fbf1b (diff) | |
download | perl-c43a0d1c08263915bcac804cc40b350d03a1b68f.tar.gz |
Fix uninitialized pointer bug in VMS version of readdir() when
case preservation feature is enabled.
p4raw-id: //depot/perl@32603
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vms.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -9602,16 +9602,13 @@ Perl_readdir(pTHX_ DIR *dd) } dd->count++; /* Force the buffer to end with a NUL, and downcase name to match C convention. */ + buff[res.dsc$w_length] = '\0'; + p = buff + res.dsc$w_length; + while (--p >= buff) if (!isspace(*p)) break; + *p = '\0'; if (!decc_efs_case_preserve) { - buff[VMS_MAXRSS - 1] = '\0'; for (p = buff; *p; p++) *p = _tolower(*p); } - else { - /* we don't want to force to lowercase, just null terminate */ - buff[res.dsc$w_length] = '\0'; - } - while (--p >= buff) if (!isspace(*p)) break; /* Do we really need this? */ - *p = '\0'; /* Skip any directory component and just copy the name. */ sts = vms_split_path |