[ipxe-devel] [PATCH] [efi] Use memcpy to handle efi header name

Christian Nilsson nikize at gmail.com
Mon Jun 18 12:09:06 UTC 2018

On 18 June 2018 at 13:55, Christian Hesse <list at eworm.de> wrote:
> "Bernhard M. Wiedemann" <bwiedemann at suse.de> on Mon, 2018/06/18 13:43:
>> strncpy will copy 8 chars into a buffer of size 8
>> which does not leave space for the terminating null byte,
>> thus gcc8 failed compilation with
>>   In function 'process_section',
>>       inlined from 'elf2pe.isra.4' at util/elf2efi.c:913:25:
>>   util/elf2efi.c:497:2: error: 'strncpy' specified bound 8 equals
>> destination size [-Werror=stringop-truncation]
>> It seems hdr.Name is not supposed to be null-terminated,
>> so memcpy is more appropriate.
> I send an identical patch (except the message of course) on May 15th. And
> there were different solutions on the mailing list as well.
> Michael, can we commit a fix for this, please?

This is probably the 3rd thread about this, so let's go back to the
original thread:

More information about the ipxe-devel mailing list