diff options
| author | Philip Withnall <pwithnall@endlessos.org> | 2021-01-20 21:40:39 +0000 |
|---|---|---|
| committer | Philip Withnall <pwithnall@endlessos.org> | 2021-01-20 21:40:39 +0000 |
| commit | e274bafc019db147e0fa85e8b2e100ee0570cd59 (patch) | |
| tree | 31063c8ee649e45ae0e63245db2ef9acbf629df9 | |
| parent | b8d8e5bf043476364f496170b46695a7a42c7e57 (diff) | |
| download | flatpak-e274bafc019db147e0fa85e8b2e100ee0570cd59.tar.gz | |
flatpak-dir: Fix crash on updating app with no deploy data or subpaths
If an app had no deploy data, and `flatpak_dir_update()` was called with
`opt_subpaths == NULL`, then `arg_subpaths` passed to
`flatpak_dir_system_helper_call_deploy()` would be `NULL`, which causes
an assertion failure from an internal `g_variant_new()` call:
```
g_variant_new_strv: assertion 'length == 0 || strv != NULL' failed
```
Fix that by setting the `subpaths` to an empty array if nothing else is
specified.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| -rw-r--r-- | common/flatpak-dir.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 9f749b73..252d8ac7 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -9684,6 +9684,7 @@ flatpak_dir_update (FlatpakDir *self, { g_autoptr(GBytes) deploy_data = NULL; const char **subpaths = NULL; + const char *empty_subpaths[] = {NULL}; g_autofree char *url = NULL; FlatpakPullFlags flatpak_flags; g_autofree const char **old_subpaths = NULL; @@ -9706,8 +9707,10 @@ flatpak_dir_update (FlatpakDir *self, if (opt_subpaths) subpaths = opt_subpaths; - else + else if (old_subpaths) subpaths = old_subpaths; + else + subpaths = empty_subpaths; if (!ostree_repo_remote_get_url (self->repo, state->remote_name, &url, error)) return FALSE; |
