Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:ARM
qemu-testsuite.20428
2003-ipxe-efi-guard-strncpy-with-gcc-war.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2003-ipxe-efi-guard-strncpy-with-gcc-war.patch of Package qemu-testsuite.20428
From: Bruce Rogers <brogers@suse.com> Date: Wed, 25 Apr 2018 10:26:28 -0600 Subject: ipxe: efi: guard strncpy with gcc warning ignore pragma Using gcc 8 with the -Wstringop-truncation option, and with warnings treated as errors, the following error is emitted: util/elf2efi.c:494:2: error: 'strncpy' specified bound 8 equals destination size [-Werror=stringop-truncation] strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use gcc pragmas surrounding this line of code which avoid this warning. The strncpy usage here is correct. [BR: BSC#1090355] Signed-off-by: Bruce Rogers <brogers@suse.com> --- src/util/elf2efi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roms/ipxe/src/util/elf2efi.c b/roms/ipxe/src/util/elf2efi.c index 27f37d98a6d6a3119272611bf0b1..f932728f74143c2a9a451922f9cb 100644 --- a/roms/ipxe/src/util/elf2efi.c +++ b/roms/ipxe/src/util/elf2efi.c @@ -491,7 +491,13 @@ static struct pe_section * process_section ( struct elf_file *elf, memset ( new, 0, sizeof ( *new ) + section_filesz ); /* Fill in section header details */ +/* gcc 8 warning gives false positive here - our usage is correct */ +#pragma GCC diagnostic push +#if __GNUC__ >= 8 +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) ); +#pragma GCC diagnostic pop new->hdr.Misc.VirtualSize = section_memsz; new->hdr.VirtualAddress = shdr->sh_addr; new->hdr.SizeOfRawData = section_filesz;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor