qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/xen: Check if len is 0 before memcpy()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/xen: Check if len is 0 before memcpy()
Date: Wed, 8 Jan 2025 12:42:41 +0100
User-agent: Mozilla Thunderbird

On 8/1/25 12:31, Akihiko Odaki wrote:
data->data can be NULL when len is 0. Strictly speaking, the behavior
of memcpy() in such a scenario is undefined so UBSan complaints.

Satisfy UBSan by checking if len is 0 before memcpy().

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
  hw/i386/kvm/xen_xenstore.c | 4 ++++
  1 file changed, 4 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]