1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-29 11:21:54 +03:00
samba-mirror/source3/torture/t_stringoverflow.c
Michael Adam 350352cf38 s3:torture: make t_stringoverflow.c compile at least (pstring is long gone)
I don't know whether these t_* programs are used at all any more, but this
one was using pstrcpy...

Michael
2009-12-01 00:55:34 +01:00

24 lines
492 B
C

#include "includes.h"
int main(void)
{
char dest[100];
char *ptr = 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. */
#if 0
/* As of CVS 20030318, this will be trapped at compile time! */
pstrcpy(dest, "hello");
#endif /* 0 */
fstrcpy(ptr, "hello!");
return 0;
}