source: zzuf/trunk/test/bug-overflow.c @ 2545

Last change on this file since 2545 was 2545, checked in by Sam Hocevar, 12 years ago
  • Add a bunch of unit tests to check for zzuf basic capabilities: SIGSEGV and SIGFPE detection, memory exhaustion detection.
File size: 711 bytes
Line 
1/*
2 *  bug-overflow - program causing a buffer overflow when fuzzed
3 *  Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id$
7 *
8 *  This program is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15#include "config.h"
16
17#include <stdio.h>
18#include <stdlib.h>
19
20char buf[1];
21
22int main(void)
23{
24    int ch;
25
26    while((ch = getc(stdin)) != EOF)
27        buf[ch * 1024 * 1024] = ch;
28
29    return EXIT_SUCCESS;
30}
31
Note: See TracBrowser for help on using the repository browser.