run: Error out if file forwarding of empty paths is attempted

The file forwarding feature errors out when the path or URI does not
lead to an actual file that can be forwarded. The empty path never
describes an actual file, so we always have to error out.

Without the check, we would get a NULL path from
`flatpak_file_get_path_cached` and crash later.

Closes: #6689
This commit is contained in:
Sebastian Wick
2026-06-13 16:02:52 +02:00
parent fdb1741789
commit c4fce9e42a

View File

@@ -2724,6 +2724,9 @@ add_rest_args (FlatpakBwrap *bwrap,
}
else
file = g_file_new_for_path (args[i]);
if (flatpak_file_get_path_cached (file) == NULL)
return flatpak_fail (error, _("Invalid path %s"), args[i]);
}
if (file && !flatpak_exports_path_is_visible (exports,