Subject: [PATCH 08/20] s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.

From: Jeremy Allison <[email-masked]>
Date: Fri, 20 Jan 2017 11:48:40 -0800

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <[email-masked]>
Reviewed-by: Uri Simchoni <[email-masked]>
(backported from commit 37ef8d3f65bd1215717eb51b2e1cdb84a7bed348)
---
 source3/modules/vfs_shadow_copy2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 5f2e812..e7ffcae 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) {
-- 
2.7.4