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 0c892214f7
This commit is contained in:
Luca Boccassi
2025-08-25 19:08:25 +01:00
parent ce3b12713b
commit 9ce6d08196
+2
View File
@@ -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)