On 10/04/2017 09:22 AM, Jan Beulich wrote:
>>>> On 25.09.17 at 16:26, <george.dun...@citrix.com> wrote:
>> --- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
>> +++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
>> @@ -52,6 +52,22 @@ struct fuzz_state
>>      struct x86_emulate_ops ops;
>>  };
>>  
>> +static inline bool input_available(struct fuzz_state *s, size_t size)
> 
> s can be pointer to const
> 
> Also how about shortening the function name to what the title says?

Sure.

> 
>> +{
>> +    return s->data_index + size < s->data_num;
> 
> Shouldn't this be <= ?

Yes actually.

> 
>> +}
>> +
>> +static inline bool input_read(struct fuzz_state *s, void *dst, size_t size)
>> +{
>> +    if ( !input_available(s, size) )
>> +        return 0;
> 
> false
> 
>> +
>> +    memcpy(dst, &s->corpus->data[s->data_index], size);
>> +    s->data_index += size;
>> +
>> +    return 1;
> 
> true

Ack.

 -George

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

Reply via email to