From: Luca Boccassi Date: Mon, 23 Mar 2026 00:25:46 +0000 (+0000) Subject: core: also set iov_len when deserializing LogExtraFields= X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaac2d3edaeb326f7a1b1140ae05b459922bc7e9;p=thirdparty%2Fsystemd.git core: also set iov_len when deserializing LogExtraFields= This is not actually used so it doesn't really matter in practice and the fields are used anyway, but for cleanliness fix it Reported on yeswehack.com as YWH-PGM9780-165 Follow-up for 5699a1689b7e49702e4e60d08ab3fe386ba8d4df --- diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 8f9a7ac5464..c8f802687ee 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -3113,9 +3113,11 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { if (!GREEDY_REALLOC(c->log_extra_fields, c->n_log_extra_fields + 1)) return log_oom_debug(); - c->log_extra_fields[c->n_log_extra_fields++].iov_base = strdup(val); - if (!c->log_extra_fields[c->n_log_extra_fields-1].iov_base) + char *field = strdup(val); + if (!field) return log_oom_debug(); + + c->log_extra_fields[c->n_log_extra_fields++] = IOVEC_MAKE_STRING(field); } else if ((val = startswith(l, "exec-context-log-namespace="))) { r = free_and_strdup(&c->log_namespace, val); if (r < 0)