summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-16 03:21:58 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-16 03:21:58 +0000
commit7cf0003dd23114947eec5fb6956f65f85efac7c1 (patch)
tree9beac41b7d23c3037a8ea01b7843dbfa2cf3e610 /source3/include
parent2f62a72d9aebf3cfe9aa60a0bdc73f1ae477d5b2 (diff)
downloadsamba-7cf0003dd23114947eec5fb6956f65f85efac7c1.tar.gz
samba-7cf0003dd23114947eec5fb6956f65f85efac7c1.tar.bz2
samba-7cf0003dd23114947eec5fb6956f65f85efac7c1.zip
Fix nmbd under -DDEVELOPER (pstrcpy on not-pstring).
Make a new macro to help in this situation, and add memcpy() parinoia Andrew Bartlett (This used to be commit 4d00626b6e003952df6715fa80615ec028facdf4)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/safe_string.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h
index 3bd38ea74e..65ec05a5c6 100644
--- a/source3/include/safe_string.h
+++ b/source3/include/safe_string.h
@@ -110,6 +110,8 @@ size_t __unsafe_string_function_usage_here_char__(void);
#define pstrcpy_base(dest, src, pstring_base) \
safe_strcpy(dest, src, sizeof(pstring)-PTR_DIFF(dest,pstring_base)-1)
+#define safe_strcpy_base(dest, src, base, size) \
+ safe_strcpy(dest, src, size-PTR_DIFF(dest,base)-1)
/* String copy functions - macro hell below adds 'type checking' (limited, but the best we can
do in C) and may tag with function name/number to record the last 'clobber region' on