From cf009d24dd41477b769a7e71a276eaeb49da2f13 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Wed, 1 Apr 2020 13:11:42 -0700 Subject: [PATCH] helpers: Prefer str_or_die() than other printf methods. Signed-off-by: Otavio Pontes --- src/helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers.c b/src/helpers.c index c50295b1..124b137c 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -1259,12 +1259,13 @@ void warn_nosigcheck(const char *file) if (first_time) { const char *flag = globals.sigcheck ? "--nosigcheck-latest" : "--nosigcheck"; - char journal_msg[LINE_MAX] = { 0 }; + char *journal_msg; warn("The %s flag was used and this compromises the system security\n", flag); - snprintf(journal_msg, sizeof(journal_msg), "swupd security notice: %s used to bypass MoM signature verification", flag); + journal_msg = str_or_die("swupd security notice: %s used to bypass MoM signature verification", flag); journal_log_error(journal_msg); + free(journal_msg); first_time = false; }