summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-02-09 17:33:51 -0600
committerCraig A. Berry <craigberry@mac.com>2012-02-09 17:33:51 -0600
commite645f6f85b37f489934a5d203a215f35fd765ed6 (patch)
tree20d9943529b9147a433426d8647204e744f225fe /vms
parent8129baca5dd762540c807db6ddf8d2e9fa4121b2 (diff)
downloadperl-e645f6f85b37f489934a5d203a215f35fd765ed6.tar.gz
Avoid null pointer dereference in tovmsspec.
Before 360732b5267d5, when dirend was either never set at all or set to NULL, the routine always returned early before executing the parts that look at dirend. But after that change it became possible to dereference a null dirend pointer. Let's not do that.
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 2a989c8b8e..4547a2de92 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -8402,8 +8402,7 @@ static char *int_tovmsspec
return rslt;
}
}
-
- if (*(dirend+1) == '.') { /* do we have trailing "/." or "/.." or "/..."? */
+ else if (*(dirend+1) == '.') { /* do we have trailing "/." or "/.." or "/..."? */
if (!*(dirend+2)) dirend +=2;
if (*(dirend+2) == '.' && !*(dirend+3)) dirend += 3;
if (decc_efs_charset == 0) {