mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
2f07f71d78
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 cea126f62a
)
24 lines
490 B
C
24 lines
490 B
C
#include "includes.h"
|
|
|
|
int main(void)
|
|
{
|
|
fstring dest;
|
|
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 */
|
|
|
|
pstrcpy(ptr, "hello!");
|
|
|
|
return 0;
|
|
}
|