|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 05/13] fuzz/x86_emulate: Implement input_read() and input_avail()
On 10/04/2017 09:22 AM, Jan Beulich wrote:
>>>> On 25.09.17 at 16:26, <george.dunlap@xxxxxxxxxx> 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |