diff options
author | Volker Lendecke <vl@samba.org> | 2010-02-03 14:06:25 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2010-02-15 14:46:50 +0100 |
commit | b5c8ef81bd5178ceb68b492a1eeac911289edb82 (patch) | |
tree | d55a02e724e7dc5a4ac199319e2a7847cf998401 /source3/modules | |
parent | fb5f17d642be3a21cd94621714cb85d77abc7606 (diff) | |
download | samba-b5c8ef81bd5178ceb68b492a1eeac911289edb82.tar.gz |
s3: Simplify the code a bit: Catch (len==0) early
Part of a fix for bug #7081.
(cherry picked from commit ecec9fb2d283f17aee8eceb39ab61d8204cff0f3)
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_expand_msdfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c index f58af205f90..59f6f7a5b89 100644 --- a/source3/modules/vfs_expand_msdfs.c +++ b/source3/modules/vfs_expand_msdfs.c @@ -187,7 +187,7 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle, result = SMB_VFS_NEXT_READLINK(handle, path, target, PATH_MAX); - if (result < 0) + if (result <= 0) return result; target[result] = '\0'; @@ -202,12 +202,9 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle, } len = MIN(bufsiz, strlen(target)); - if (len) { - memcpy(buf, target, len); - } else { - errno = ENOENT; - return -1; - } + + memcpy(buf, target, len); + TALLOC_FREE(target); return len; } |