summaryrefslogtreecommitdiff
path: root/source/libsmb/clidfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/libsmb/clidfs.c')
-rw-r--r--source/libsmb/clidfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c
index 03cfd4dd400..298f4d1b548 100644
--- a/source/libsmb/clidfs.c
+++ b/source/libsmb/clidfs.c
@@ -415,7 +415,7 @@ static void clean_path( pstring clean, const char *path )
/* strip a trailing backslash */
len = strlen( newpath );
- if ( newpath[len-1] == '\\' )
+ if ( (len > 0) && (newpath[len-1] == '\\') )
newpath[len-1] = '\0';
pstrcpy( clean, newpath );