From aaac2d3edaeb326f7a1b1140ae05b459922bc7e9 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 23 Mar 2026 00:25:46 +0000 Subject: [PATCH] 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 --- src/core/execute-serialize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 8f9a7ac546..c8f802687e 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)