static code analyzer complain:
hw/usb/dev-smartcard-reader.c:816:5: warning: Null pointer passed as an
argument to a 'nonnull' parameter
memcpy(p->abData, data, len);
^~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Marc-
Hi Markus, Gerd.
On 03/23/2017 11:08 AM, Markus Armbruster wrote:
Gerd Hoffmann writes:
On Do, 2017-03-23 at 13:41 +0100, Markus Armbruster wrote:
Gerd Hoffmann writes:
Hi,
oops, there are hard-coded calls with NULL/0. I suppose to fix clang
warning, it would need to check if data !=
Philippe Mathieu-Daudé writes:
> static code analyzer complain:
>
> hw/usb/dev-smartcard-reader.c:816:5: warning: Null pointer passed as an
> argument to a 'nonnull' parameter
> memcpy(p->abData, data, len);
> ^~~~
>
> Reported-by: Clang Static Analyzer
> Signed-o
Hi,
> > +if (len == 0) {
> > +return;
>
> Correct only if messages without data always have the same meaning as no
> message. Gerd?
Not a ccid expert, but looking through the code it seems writing a
(reply) data block with status and without payload (data = NULL and len
= 0) is pe
Hi
On Thu, Mar 23, 2017 at 11:44 AM Gerd Hoffmann wrote:
> Hi,
>
> > > +if (len == 0) {
> > > +return;
> >
> > Correct only if messages without data always have the same meaning as no
> > message. Gerd?
>
> Not a ccid expert, but looking through the code it seems writing a
> (repl
Hi,
> oops, there are hard-coded calls with NULL/0. I suppose to fix clang
> warning, it would need to check if data != null for memcpy.
I'd check for len > 0, and in that if branch we can also assert on data
== NULL and thereby check that len and data are consistent.
cheers,
Gerd
Gerd Hoffmann writes:
> Hi,
>
>> oops, there are hard-coded calls with NULL/0. I suppose to fix clang
>> warning, it would need to check if data != null for memcpy.
>
> I'd check for len > 0, and in that if branch we can also assert on data
> == NULL and thereby check that len and data are con
On Do, 2017-03-23 at 13:41 +0100, Markus Armbruster wrote:
> Gerd Hoffmann writes:
>
> > Hi,
> >
> >> oops, there are hard-coded calls with NULL/0. I suppose to fix clang
> >> warning, it would need to check if data != null for memcpy.
> >
> > I'd check for len > 0, and in that if branch we ca
Gerd Hoffmann writes:
> On Do, 2017-03-23 at 13:41 +0100, Markus Armbruster wrote:
>> Gerd Hoffmann writes:
>>
>> > Hi,
>> >
>> >> oops, there are hard-coded calls with NULL/0. I suppose to fix clang
>> >> warning, it would need to check if data != null for memcpy.
>> >
>> > I'd check for le