diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-11-29 16:12:04 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-17 20:10:33 +0300 |
commit | 838ccf62b75e32942cb4c397d43e5f6ff9aa8f5f (patch) | |
tree | aa545031ef6dc32db3d13aed28c14e14f9718e71 /meta-openpower | |
parent | b333a44725b98930f63631da606b6dff69fb0e7a (diff) | |
download | openbmc-838ccf62b75e32942cb4c397d43e5f6ff9aa8f5f.tar.xz |
skiboot: fix stringop-truncations
These warnings start to occur under GCC8.
Submitted to upstream skiboot:
https://patchwork.ozlabs.org/patch/1001179/
(From meta-openpower rev: ddbe3f7349269e5b2a94581fd7e5908159fab2e2)
Change-Id: I9257e7e37c563d62660980ed07ebba12e828093a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openpower')
-rw-r--r-- | meta-openpower/recipes-bsp/skiboot/skiboot.inc | 1 | ||||
-rw-r--r-- | meta-openpower/recipes-bsp/skiboot/skiboot/0001-libffs-fix-gcc8-stringop-truncation-warnings.patch | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/meta-openpower/recipes-bsp/skiboot/skiboot.inc b/meta-openpower/recipes-bsp/skiboot/skiboot.inc index 7ac1c08f9..ab455b0eb 100644 --- a/meta-openpower/recipes-bsp/skiboot/skiboot.inc +++ b/meta-openpower/recipes-bsp/skiboot/skiboot.inc @@ -2,6 +2,7 @@ HOMEPAGE = "https://github.com/open-power" LICENSE = "Apache-2.0" SRC_URI += "git://github.com/open-power/skiboot.git" +SRC_URI += "file://0001-libffs-fix-gcc8-stringop-truncation-warnings.patch" FILESEXTRAPATHS_append := "${THISDIR}/skiboot:" diff --git a/meta-openpower/recipes-bsp/skiboot/skiboot/0001-libffs-fix-gcc8-stringop-truncation-warnings.patch b/meta-openpower/recipes-bsp/skiboot/skiboot/0001-libffs-fix-gcc8-stringop-truncation-warnings.patch new file mode 100644 index 000000000..0e7348ad9 --- /dev/null +++ b/meta-openpower/recipes-bsp/skiboot/skiboot/0001-libffs-fix-gcc8-stringop-truncation-warnings.patch @@ -0,0 +1,35 @@ +From 0876e5091c5ed06bae8a2bac296d04b1d0e87f56 Mon Sep 17 00:00:00 2001 +From: Brad Bishop <bradleyb@fuzziesquirrel.com> +Date: Wed, 21 Nov 2018 08:54:45 -0500 +Subject: [PATCH] libffs: fix gcc8 stringop-truncation warnings + +Copy the null byte too in this copy operation to avoid the following +warning: + +| libflash/libffs.c: In function 'ffs_part_info': +| libflash/libffs.c:525:3: error: 'strncpy' output may be truncated copying 15 bytes from a string of length 15 [-Werror=stringop-truncation] +| strncpy(n, ent->name, FFS_PART_NAME_MAX); +| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> +Upstream-Status: Submitted +--- + libflash/libffs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libflash/libffs.c b/libflash/libffs.c +index 221c2b02..816153d3 100644 +--- a/libflash/libffs.c ++++ b/libflash/libffs.c +@@ -522,7 +522,7 @@ int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx, + n = calloc(1, FFS_PART_NAME_MAX + 1); + if (!n) + return FLASH_ERR_MALLOC_FAILED; +- strncpy(n, ent->name, FFS_PART_NAME_MAX); ++ strncpy(n, ent->name, FFS_PART_NAME_MAX +1); + *name = n; + } + return 0; +-- +2.19.1 + |