summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-13 19:43:56 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-14 12:23:08 +0200
commitb7dba4bde1d60162b8430c29be8271f8625888ed (patch)
tree51ab59508d83a16ad02f56e30ca5edc3ecff6ca6 /lib.c
parent696465f104d89be8e9e7ca8045292a3aa4ffcc68 (diff)
lib: selectively disable format string security checks for ut_printf_common()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index dbbb028..2dba05b 100644
--- a/lib.c
+++ b/lib.c
@@ -1433,6 +1433,8 @@ ut_printf_common(struct ut_state *s, uint32_t off, struct json_object *args, cha
*fp++ = (t == json_type_string) ? 's' : *p;
*fp = 0;
+#pragma GCC diagnostic ignored "-Wformat-security"
+
switch (t) {
case json_type_int: sprintf_append(res, &len, sfmt, arg.n); break;
case json_type_double: sprintf_append(res, &len, sfmt, arg.d); break;
@@ -1440,6 +1442,8 @@ ut_printf_common(struct ut_state *s, uint32_t off, struct json_object *args, cha
default: sprintf_append(res, &len, sfmt); break;
}
+#pragma GCC diagnostic pop
+
last = p + 1;
next: