diff options
author | Martin Pool <mbp@samba.org> | 2003-03-18 05:31:52 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2003-03-18 05:31:52 +0000 |
commit | 2f07f71d787dc2dfcefac6a1f723c2cde76d4884 (patch) | |
tree | b973bcfc2f726179287dc0736c7a42e573f0828b | |
parent | 556fea4e1e68d9d0c711a87905d9be310add7f83 (diff) | |
download | samba-2f07f71d787dc2dfcefac6a1f723c2cde76d4884.tar.gz samba-2f07f71d787dc2dfcefac6a1f723c2cde76d4884.tar.bz2 samba-2f07f71d787dc2dfcefac6a1f723c2cde76d4884.zip |
The new string macros catch a bug at compile that previously only
trapped at runtime, which is great. So we have to try a little harder
to provoke an overflow -- which is still caught nicely in developer
mode.
(This used to be commit cea126f62ad411f5efbebc7c5d39297fd8ef9efb)
-rw-r--r-- | source3/torture/t_stringoverflow.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/torture/t_stringoverflow.c b/source3/torture/t_stringoverflow.c index b0503adb8f..ec14d81189 100644 --- a/source3/torture/t_stringoverflow.c +++ b/source3/torture/t_stringoverflow.c @@ -3,6 +3,7 @@ int main(void) { fstring dest; + char *ptr = dest; printf("running on valgrind? %d\n", RUNNING_ON_VALGRIND); @@ -10,7 +11,13 @@ * will actually fit, but this is still wrong because you * can't pstrcpy into an fstring. This should trap in a * developer build. */ + +#if 0 + /* As of CVS 20030318, this will be trapped at compile time! */ pstrcpy(dest, "hello"); +#endif /* 0 */ + + pstrcpy(ptr, "hello!"); return 0; } |