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

Re: [Xen-devel] [PATCH v2 08/13] fuzz/x86_emulate: Take multiple test files for inputs



>>> On 25.09.17 at 16:26, <george.dunlap@xxxxxxxxxx> wrote:
> --- a/tools/fuzz/x86_instruction_emulator/afl-harness.c
> +++ b/tools/fuzz/x86_instruction_emulator/afl-harness.c
> @@ -16,6 +16,8 @@ int main(int argc, char **argv)
>  {
>      size_t size;
>      FILE *fp = NULL;
> +    int count = 0;
> +    int max;

Generally speaking these should be unsigned int, but I see how this
collides with the types of the variables max is being calculated from.
In any event both could go on a single line.

> @@ -66,11 +70,14 @@ int main(int argc, char **argv)
>      __AFL_INIT();
>  
>      while ( __AFL_LOOP(1000) )
> +#else
> +    for( count = 0; count < max; count++ )

Initially I've thought the initializer on count was pointless further
up because of the re-initialization here. Of course that's needed
because of the #if/#else this sits in. Hence I wonder whether omitting
the assignment here wouldn't be appropriate - it wouldn't really be
wromng for a compiler to warn about this redundancy.

Either way
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
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®.