qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.12] dump: Fix build with newer gcc


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-2.12] dump: Fix build with newer gcc
Date: Fri, 6 Apr 2018 10:06:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/03/2018 01:46 PM, Eric Blake wrote:
> On 03/27/2018 03:21 PM, Eric Blake wrote:
>> gcc 8 on rawhide is picky enough to complain:
>>
>> /home/dummy/qemu/dump.c: In function 'create_header32':
>> /home/dummy/qemu/dump.c:817:5: error: 'strncpy' output truncated before 
>> terminating nul copying 8 bytes from a string of the same length 
>> [-Werror=stringop-truncation]
>>      strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
>>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> But we already have SIG_LEN defined as the right length without needing
>> to do a strlen(), and memcpy() is better than strncpy() when we know
>> we do not want a trailing NUL byte.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> ---
>>  dump.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> I'll include this in my qapi+misc pull request for 2.12-rc2

That pull request was abandoned; Paolo, do you want to pick this up in
your misc tree?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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