From d1b426bcbbc4a157f2060a39b44b8a14181a8379 Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Thu, 5 Jul 2018 17:41:55 +0800 Subject: [PATCH] optee-client-qoriq: GCC 8 format-truncation error *Fix the below error: |libteec/src/teec_trace.c:110:24: error: '%s' directive output may be truncated |writing up to 255 bytes into a region of size 246 [-Werror=format-truncation=] Signed-off-by: Chunrong Guo Signed-off-by: Otavio Salvador (cherry picked from commit 0368b34d0d593de5d6e3a8770d5c80e4ed43c1ab) --- recipes-security/optee/optee-client-qoriq.bb | 1 + .../0001-GCC-8-format-truncation-error.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch diff --git a/recipes-security/optee/optee-client-qoriq.bb b/recipes-security/optee/optee-client-qoriq.bb index 24fa2874..0a76743b 100644 --- a/recipes-security/optee/optee-client-qoriq.bb +++ b/recipes-security/optee/optee-client-qoriq.bb @@ -8,6 +8,7 @@ inherit pythonnative systemd SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_client;nobranch=1 \ file://0001-Respect-LDFLAGS-set-from-OE-build.patch \ + file://0001-GCC-8-format-truncation-error.patch \ " S = "${WORKDIR}/git" diff --git a/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch b/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch new file mode 100644 index 00000000..f58590c3 --- /dev/null +++ b/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch @@ -0,0 +1,35 @@ +From 05f741c1e6263bec2977901abe61463b7f8175ad Mon Sep 17 00:00:00 2001 +From: Chunrong Guo +Date: Fri, 22 Jun 2018 11:58:09 +0800 +Subject: [PATCH] GCC 8 format-truncation error + +Signed-off-by: BJ DevOps Team +--- + libteec/src/teec_trace.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libteec/src/teec_trace.c b/libteec/src/teec_trace.c +index 78b79d6..7901deb 100644 +--- a/libteec/src/teec_trace.c ++++ b/libteec/src/teec_trace.c +@@ -73,7 +73,7 @@ int _dprintf(const char *function, int flen, int line, int level, + const char *prefix, const char *fmt, ...) + { + char raw[MAX_PRINT_SIZE]; +- char prefixed[MAX_PRINT_SIZE]; ++ char prefixed[MAX_PRINT_SIZE + 10]; + char *to_print = NULL; + const char *func; + int err; +@@ -106,7 +106,7 @@ int _dprintf(const char *function, int flen, int line, int level, + */ + int thread_id = syscall(SYS_gettid); /* perf issue ? */ + +- snprintf(prefixed, MAX_PRINT_SIZE, ++ snprintf(prefixed, MAX_PRINT_SIZE + 10, + "%s [%d] %s:%s:%d: %s", + trace_level_strings[level], thread_id, prefix, func, + line, raw); +-- +1.8.3.1 + -- 2.40.1