[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_w
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers |
Date: |
Thu, 23 Mar 2017 14:56:46 +0100 |
On Do, 2017-03-23 at 13:41 +0100, Markus Armbruster wrote:
> Gerd Hoffmann <address@hidden> 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 consistent.
>
> If len is non-zero but data is null, memcpy() will crash just fine by
> itself, so why bother asserting.
To make clang happy? But maybe clang is clever enough to figure data
can't be null at that point in case we call memcpy with len != 0
only ...
cheers,
Gerd
- [Qemu-trivial] [PATCH RESEND 0/3] easy-to-fix clang warnings, Philippe Mathieu-Daudé, 2017/03/22
- [Qemu-trivial] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Philippe Mathieu-Daudé, 2017/03/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Gerd Hoffmann, 2017/03/23
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Marc-André Lureau, 2017/03/23
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Gerd Hoffmann, 2017/03/23
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers,
Gerd Hoffmann <=
- Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
[Qemu-trivial] [PATCH RESEND 2/3] device_tree: fix compiler warnings (clang 5), Philippe Mathieu-Daudé, 2017/03/22
[Qemu-trivial] [PATCH RESEND 3/3] qga: fix compiler warnings (clang 5), Philippe Mathieu-Daudé, 2017/03/22