summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clidfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 03cfd4dd40..298f4d1b54 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/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 );