Second part of fix for bug #7781 - Samba transforms ShareName to lowercase (sharename...
authorJeremy Allison <jra@samba.org>
Thu, 1 Nov 2012 18:56:22 +0000 (11:56 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 Nov 2012 10:10:14 +0000 (11:10 +0100)
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

index 17a4a8f2c4e9727f56a0c559d70de14ac4c14c57..c98bebe21c129144bad7825ed7ecfcc60a189780 100644 (file)
@@ -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