diff options
author | Lincoln Ramsay <a1291762@gmail.com> | 2021-03-24 17:37:25 +1000 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-03-24 11:26:20 +0100 |
commit | 7deae040617834bf4d5b881fc49bb3e567d527f0 (patch) | |
tree | 99c6443ceda0c7ad00e8efbee37642d7ab7975dc | |
parent | 29ca310e6190a319c36008837266d4f4a60807a1 (diff) | |
download | systemd-7deae040617834bf4d5b881fc49bb3e567d527f0.tar.gz |
pid1: do not use generated strings as format strings (#19098)
The generated string may include %, which will confuse both the
xprintf call, and the VA_FORMAT_ADVANCE macro.
Pass the generated string as an argument to a "%s" format string
instead.
(cherry picked from commit 7325a2b2d15af09a9389723d6153050130c0bd36)
(cherry picked from commit 0d4ba1519552761baeb4b464fad8854b24497193)
-rw-r--r-- | src/core/transaction.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c index cbddfa5afc..07f8505d36 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -408,7 +408,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi j->unit->id, unit_id == array ? "ordering cycle" : "dependency", *unit_id, *job_type, - unit_ids); + "%s", unit_ids); if (delete) { const char *status; @@ -417,7 +417,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi "MESSAGE=%s: Job %s/%s deleted to break ordering cycle starting with %s/%s", j->unit->id, delete->unit->id, job_type_to_string(delete->type), j->unit->id, job_type_to_string(j->type), - unit_ids); + "%s", unit_ids); if (log_get_show_color()) status = ANSI_HIGHLIGHT_RED " SKIP " ANSI_NORMAL; @@ -435,7 +435,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi log_struct(LOG_ERR, "MESSAGE=%s: Unable to break cycle starting with %s/%s", j->unit->id, j->unit->id, job_type_to_string(j->type), - unit_ids); + "%s", unit_ids); return sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, "Transaction order is cyclic. See system logs for details."); |