From: Luca Boccassi Date: Sun, 24 Aug 2025 16:57:34 +0000 (+0100) Subject: import-generator: fix crash with no remote string in systemd.pull= X-Git-Tag: v258-rc4~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce6d08196bf0aa7364ce757ca083856d62654c0;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/import/import-generator.c b/src/import/import-generator.c index 7b4a96f8a7c..bf0eaa5c0ea 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)