diff options
-rw-r--r-- | source3/torture/t_stringoverflow.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/torture/t_stringoverflow.c b/source3/torture/t_stringoverflow.c new file mode 100644 index 0000000000..b0503adb8f --- /dev/null +++ b/source3/torture/t_stringoverflow.c @@ -0,0 +1,16 @@ +#include "includes.h" + + int main(void) +{ + fstring dest; + + printf("running on valgrind? %d\n", RUNNING_ON_VALGRIND); + + /* Try copying a string into an fstring buffer. The string + * will actually fit, but this is still wrong because you + * can't pstrcpy into an fstring. This should trap in a + * developer build. */ + pstrcpy(dest, "hello"); + + return 0; +} |