about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/hashtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index d820c4fd4..160cda506 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1258,7 +1258,8 @@ add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dumm
 
     if (vallen > keylen && *(p = val + keylen) == ':') {
 	*p++ = '\0';
-	if ((de = strrchr(p, ':'))) {
+	for (de = val + vallen - 1; *de != ':' && de > val; de--);
+	if (de > val) {
 	    *de = '\0';
 	    if ((d = strrchr(p, ':'))) {
 		if (*++d && val[0])