Re: [Qemu-devel] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing

2017-07-26 Thread Philippe Mathieu-Daudé
On 07/24/2017 03:37 PM, Eric Blake wrote: On 07/24/2017 01:27 PM, Philippe Mathieu-Daudé wrote: thunk.c:91:32: warning: Call to 'malloc' has an allocation size of 0 bytes se->field_offsets[i] = malloc(nb_fields * sizeof(int));

Re: [Qemu-devel] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing

2017-07-24 Thread Peter Maydell
On 24 July 2017 at 19:27, Philippe Mathieu-Daudé wrote: > thunk.c:91:32: warning: Call to 'malloc' has an allocation size of 0 bytes > se->field_offsets[i] = malloc(nb_fields * sizeof(int)); >^~~ > > Reported-by:

Re: [Qemu-devel] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing

2017-07-24 Thread Eric Blake
On 07/24/2017 01:27 PM, Philippe Mathieu-Daudé wrote: > thunk.c:91:32: warning: Call to 'malloc' has an allocation size of 0 bytes > se->field_offsets[i] = malloc(nb_fields * sizeof(int)); >^~~ > > Reported-by: Clang Static

[Qemu-devel] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing

2017-07-24 Thread Philippe Mathieu-Daudé
thunk.c:91:32: warning: Call to 'malloc' has an allocation size of 0 bytes se->field_offsets[i] = malloc(nb_fields * sizeof(int)); ^~~ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daudé ---