~ubuntu-branches/ubuntu/maverick/samba/maverick-proposed

« back to all changes in this revision

Viewing changes to source/torture/t_stringoverflow.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-10-15 12:31:58 UTC
  • Revision ID: james.westby@ubuntu.com-20041015123158-aokykzdqkdgy6dfx
Tags: upstream-3.0.7
ImportĀ upstreamĀ versionĀ 3.0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "includes.h"
 
2
 
 
3
 int main(void)
 
4
{
 
5
        fstring dest;
 
6
        char *ptr = dest;
 
7
 
 
8
        printf("running on valgrind? %d\n", RUNNING_ON_VALGRIND);
 
9
 
 
10
        /* Try copying a string into an fstring buffer.  The string
 
11
         * will actually fit, but this is still wrong because you
 
12
         * can't pstrcpy into an fstring.  This should trap in a
 
13
         * developer build. */
 
14
 
 
15
#if 0
 
16
        /* As of CVS 20030318, this will be trapped at compile time! */
 
17
        pstrcpy(dest, "hello");
 
18
#endif /* 0 */
 
19
 
 
20
        pstrcpy(ptr, "hello!");
 
21
 
 
22
        return 0;
 
23
}