From: Jeremy Allison Date: Fri, 20 Jan 2017 19:48:40 +0000 (-0800) Subject: s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length. X-Git-Tag: samba-4.4.10~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65c38d7f256cf5fdb44b9945aae4be9f3df14543;p=thirdparty%2Fsamba.git s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531 Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni (backported from commit 37ef8d3f65bd1215717eb51b2e1cdb84a7bed348) --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 5f2e812c0a7..e7ffcae685c 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -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) {