]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.
authorJeremy Allison <jra@samba.org>
Fri, 20 Jan 2017 19:48:40 +0000 (11:48 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 15 Feb 2017 10:42:22 +0000 (11:42 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 37ef8d3f65bd1215717eb51b2e1cdb84a7bed348)

source3/modules/vfs_shadow_copy2.c

index 5f2e812c0a785bddcb0594b0b9c537ad270eb1df..e7ffcae685c3ab2a3148958dc3adf72b83ff120d 100644 (file)
@@ -2123,7 +2123,7 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
        }
 
        if (config->rel_connectpath == NULL &&
-           strlen(basedir) != strlen(handle->conn->connectpath)) {
+           strlen(basedir) < strlen(handle->conn->connectpath)) {
                config->rel_connectpath = talloc_strdup(config,
                        handle->conn->connectpath + strlen(basedir));
                if (config->rel_connectpath == NULL) {