diff options
author | Martin Pool <mbp@samba.org> | 2003-02-17 23:33:55 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2003-02-17 23:33:55 +0000 |
commit | 789780275c8408325143f68272088e702753424a (patch) | |
tree | 0247e74cf5c83dc9c4153def9eb8483f84947569 /source3/lib | |
parent | 21e7ce38ab57bbc9186ec1c155f21f075594a915 (diff) | |
download | samba-789780275c8408325143f68272088e702753424a.tar.gz samba-789780275c8408325143f68272088e702753424a.tar.bz2 samba-789780275c8408325143f68272088e702753424a.zip |
Add comment explaining the -DDEVELOPER safe_strcpy overflow hack.
(This used to be commit 90e1d8bdfa9ec0a4f3795d9a89db1d2324447b68)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_str.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index d4291082da..2beb67d825 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -443,7 +443,11 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) } #ifdef DEVELOPER - dest[maxlength]='\0'; + /* We intentionally write out at the extremity of the destination + * string. If the destination is too short (e.g. pstrcpy into mallocd + * or fstring) then this should cause an error under a memory + * checker. */ + dest[maxlength] = '\0'; #endif if (!src) { |