From 9ce6d08196bf0aa7364ce757ca083856d62654c0 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 24 Aug 2025 17:57:34 +0100 Subject: [PATCH] import-generator: fix crash with no remote string in systemd.pull= SYSTEMD_PROC_CMDLINE=rd.systemd.pull=raw,machine,blockdev,bootorigin:rootdisk systemd-import-generator Follow-up for 0c892214f73584e55bfa3fd8f0d54f631cb527b0 --- src/import/import-generator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/import/import-generator.c b/src/import/import-generator.c index 7b4a96f8a7..bf0eaa5c0e 100644 --- a/src/import/import-generator.c +++ b/src/import/import-generator.c @@ -71,6 +71,8 @@ static int parse_pull_expression(const char *v) { return log_error_errno(r, "Failed to extract local name from pull expression '%s': %m", v); if (r == 0) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No local string in pull expression '%s'.", v); + if (isempty(p)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No remote string in pull expression '%s'.", v); _cleanup_free_ char *remote = strdup(p); if (!remote)