summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d548f48e85..021f8c0edf 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -429,6 +429,7 @@ smb_ucs2_t *unix_clean_path(const smb_ucs2_t *s)
smb_ucs2_t *p, *r, *t;
DEBUG(3, ("unix_clean_path\n")); /* [%unicode]\n")); */
+ if(!s) return NULL;
/* convert '\' to '/' */
ns = strdup_w(s);
@@ -461,8 +462,8 @@ smb_ucs2_t *unix_clean_path(const smb_ucs2_t *s)
}
}
- /* remove any trailing /. */
- trim_string_wa(ns, NULL, "/.");
+ /* remove any leading ./ trailing /. */
+ trim_string_wa(ns, "./", "/.");
/* remove any leading and trailing / */
trim_string_wa(ns, "/", "/");
@@ -1916,6 +1917,7 @@ BOOL ms_has_wild(char *s)
BOOL ms_has_wild_w(const smb_ucs2_t *s)
{
smb_ucs2_t c;
+ if (!s) return False;
while ((c = *s++)) {
switch (c) {
case UCS2_CHAR('*'):