[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 06/12] fuzz/x86_emulate: Take multiple test files for inputs



On 10/10/17 17:20, George Dunlap wrote:
> @@ -65,12 +68,15 @@ int main(int argc, char **argv)
>  #ifdef __AFL_HAVE_MANUAL_CONTROL
>      __AFL_INIT();
>  
> -    while ( __AFL_LOOP(1000) )
> +    for( count = 0; __AFL_LOOP(1000); )
> +#else
> +    for( count = 0; count < max; count++ )
>  #endif
>      {
>          if ( fp != stdin ) /* If not using stdin, open the provided file. */
>          {
> -            fp = fopen(argv[optind], "rb");
> +            printf("Opening file %s\n", argv[optind]);
> +            fp = fopen(argv[optind + count], "rb");

I presume the printf() wants adjusting to match the fopen() ?

~Andrew

>              if ( fp == NULL )
>              {
>                  perror("fopen");
> @@ -100,7 +106,10 @@ int main(int argc, char **argv)
>          if ( !feof(fp) )
>          {
>              printf("Input too large\n");
> -            exit(-1);
> +            /* Don't exit if we're doing batch processing */
> +            if ( max == 1 )
> +                exit(-1);
> +            continue;
>          }
>  
>          if ( fp != stdin )


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.