Clobber strings with 0xf1f1f1f1 before writing to them to check buffer
authorMartin Pool <mbp@samba.org>
Mon, 10 Mar 2003 01:10:45 +0000 (01:10 +0000)
committerMartin Pool <mbp@samba.org>
Mon, 10 Mar 2003 01:10:45 +0000 (01:10 +0000)
commitde6b39d898d5fb3106d7ed80249be7f74f83caf6
treee1c9f9bfb3c80d5d0a992e94727ada7c58a04133
parentbecf7a099710ba50f4611d0e16151337236b8a93
Clobber strings with 0xf1f1f1f1 before writing to them to check buffer
lengths are correct.  Attempts to pstrcpy into an fstring or allocated
string should fail in developer builds.

This builds on abartlet's earlier overflow probe for safe_strcpy, but
by clobbering the whole string with a nonzero value is more likely to
find overflows on the stack.

This is only used in -DDEVELOPER mode.

Reviewed by abartlet, tpot.
(This used to be commit 8d915e266cd8ccc8b27e9c7ea8e9d003d05f8182)
source3/lib/util_str.c