source: zzuf/trunk/test/bug-memory.c @ 4253

Last change on this file since 4253 was 4253, checked in by sam, 5 years ago

Fix copyright information and remove Id tag everywhere.

File size: 782 bytes
Line 
1/*
2 *  bug-memory - program exhausting the memory when fuzzed
3 *  Copyright (c) 2008 Sam Hocevar <sam@hocevar.net>
4 *                All Rights Reserved
5 *
6 *  This program is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13#include "config.h"
14
15#include <stdio.h>
16#include <stdlib.h>
17
18int main(void)
19{
20    int i, ch;
21
22    while((ch = getc(stdin)) != EOF)
23    {
24        char *tmp = malloc(1 + ch * 1024 * 1024);
25        for(i = 0; i < 1024; i++)
26            tmp[ch * 1024 * i] = i;
27    }
28
29    return EXIT_SUCCESS;
30}
31
Note: See TracBrowser for help on using the repository browser.