summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util_str.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 142f0af4c8..4c6a993777 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -743,6 +743,11 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength)
{
size_t len;
+ if (maxlength == 0)
+ {
+ return dest;
+ }
+
if (!dest) {
DEBUG(0,("ERROR: NULL dest in safe_strcpy\n"));
return NULL;