]> code.ossystems Code Review - meta-freescale.git/commitdiff
optee-client-qoriq: GCC 8 format-truncation error
authorChunrong Guo <chunrong.guo@nxp.com>
Thu, 5 Jul 2018 09:41:55 +0000 (17:41 +0800)
committerOtavio Salvador <otavio@ossystems.com.br>
Thu, 5 Jul 2018 18:25:06 +0000 (15:25 -0300)
*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 <chunrong.guo@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-security/optee/optee-client-qoriq.bb
recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch [new file with mode: 0644]

index 24fa2874b2c787e86db62176226631ab200bb8c0..0a76743b9018723220ca902dd2e21037e46470a5 100644 (file)
@@ -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 (file)
index 0000000..f58590c
--- /dev/null
@@ -0,0 +1,35 @@
+From 05f741c1e6263bec2977901abe61463b7f8175ad Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Fri, 22 Jun 2018 11:58:09 +0800
+Subject: [PATCH] GCC 8 format-truncation error
+
+Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com>
+---
+ 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
+