From 5de9662ea579011839e3869c789705364efc4630 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 1 Nov 2012 11:56:22 -0700 Subject: [PATCH] Second part of fix for bug #7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC Ensure safe_strcpy is safe when src == dest. This probably needs porting to master/3.6.x/4.0.x. --- source3/lib/util_str.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 17a4a8f..c98bebe 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -514,6 +514,10 @@ char *safe_strcpy_fn(const char *fn, return NULL; } + if (src == dest) { + return dest; + } + #ifdef DEVELOPER clobber_region(fn,line,dest, maxlength+1); #endif -- 1.7.7.3