2 * Send 10K file; send random bits.
5 //FUZZ: disable check_for_improper_main_declaration
10 #define FILE_SIZE 10240
11 #define MALLOC_FAILURE "Out of memory"
21 printf("Content-type: text/plain\r\n\r\n");
23 if ( !(str_filesize
= getenv("QUERY_STRING")) )
26 if ( !strncmp(str_filesize
, "size=", 5) )
27 filesize
= atoi(&(str_filesize
[5]));
32 if ( !(buffer
= (char *)malloc(filesize
)) ) {
33 fwrite(MALLOC_FAILURE
, strlen(MALLOC_FAILURE
), 1, stdout
);
37 for (index
=0; index
< filesize
; index
++)
38 /* generate random characters from A-Z */
39 buffer
[index
] = rand() %26 + 63;
41 fwrite(buffer
, filesize
, 1, stdout
);