summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-05-30 12:40:19 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-05-30 16:23:40 +0200
commit241ecd1cc262e186ba1eef79d3cf48d5ddf08c76 (patch)
treed0a2226e3c61c1bd544e3a66a9c41e8423d73b24 /src/core
parentci: add gcc-13, drop gcc-12 (diff)
downloadsystemd-241ecd1cc262e186ba1eef79d3cf48d5ddf08c76.tar.xz
systemd-241ecd1cc262e186ba1eef79d3cf48d5ddf08c76.zip
core,shared: add a couple of asserts
To appease the LTO overlords: In file included from ../../../../src/basic/macro.h:446, from ../../../../src/shared/blockdev-util.h:8, from ../../../../src/shared/creds-util.c:11: ../../../../src/shared/creds-util.c: In function 'get_credential_host_secret': ../../../../src/shared/creds-util.c:379:52: error: '%s' directive argument is null [-Werror=format-overflow=] 379 | log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../src/basic/log.h:214:86: note: in definition of macro 'log_full_errno_zerook' 214 | ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \ | ^~~~~~~~~~~ ../../../../src/basic/log.h:250:41: note: in expansion of macro 'log_full_errno' 250 | #define log_debug_errno(error, ...) log_full_errno(LOG_DEBUG, error, __VA_ARGS__) | ^~~~~~~~~~~~~~ ../../../../src/shared/creds-util.c:379:33: note: in expansion of macro 'log_debug_errno' 379 | log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.", | ^~~~~~~~~~~~~~~ ../../../../src/shared/creds-util.c:379:74: note: format string is defined here 379 | log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.", | ^~ cc1: some warnings being treated as errors ../../../../src/core/transaction.c: In function 'transaction_verify_order_one': ../../../../src/core/transaction.c:338:38: error: '%s' directive argument is null [-Werror=format-overflow=] 338 | sprintf(ans + size, "%s%s", unit_log_field, *unit_id); | ^~ cc1: some warnings being treated as errors
Diffstat (limited to 'src/core')
-rw-r--r--src/core/transaction.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c
index c3d6ffccc1..65a00bd928 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -325,6 +325,8 @@ static char* merge_unit_ids(const char* unit_log_field, char * const* pairs) {
_cleanup_free_ char *ans = NULL;
size_t size = 0;
+ assert(unit_log_field);
+
STRV_FOREACH_PAIR(unit_id, job_type, pairs) {
size_t next;