summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-07-18 19:15:49 +0000
committerJeremy Allison <jra@samba.org>2002-07-18 19:15:49 +0000
commit5d840349bddead00cda36c3879691c879a14d4f3 (patch)
treeff7f10e52cce63e5eaac9017a22660799e0a1c19 /source3/smbd
parenta754c80ae0b71487cd2daf79d7928b6c00f15099 (diff)
downloadsamba-5d840349bddead00cda36c3879691c879a14d4f3.tar.gz
samba-5d840349bddead00cda36c3879691c879a14d4f3.tar.bz2
samba-5d840349bddead00cda36c3879691c879a14d4f3.zip
We have to look at the length before checking for "~" as the string
may be shorter than 6 chars. Caught by valgrind. Jeremy. (This used to be commit b846bbfa831922b0be52e54804a46d7870895bfc)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/mangle_hash2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index e2c4b43bc3..9d64728c7a 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -202,13 +202,13 @@ static BOOL is_mangled_component(const char *name)
M_DEBUG(0,("is_mangled_component %s ?\n", name));
- /* the best distinguishing characteristic is the ~ */
- if (name[6] != '~') return False;
-
/* check the length */
len = strlen(name);
if (len > 12 || len < 8) return False;
+ /* the best distinguishing characteristic is the ~ */
+ if (len > 7 && name[6] != '~') return False;
+
/* check extension */
if (len > 8) {
if (name[8] != '.') return False;