utils: Avoid passing a potentially NULL pointer to strlen(3)

This commit is contained in:
Debarshi Ray
2022-06-02 20:10:40 +02:00
committed by Alexander Larsson
parent dabc01c3f3
commit 50835cccfd

View File

@@ -6750,7 +6750,8 @@ flatpak_pull_from_bundle (OstreeRepo *repo,
if (metadata == NULL)
return FALSE;
metadata_size = strlen (metadata_contents);
if (metadata_contents != NULL)
metadata_size = strlen (metadata_contents);
if (!ostree_repo_get_remote_option (repo, remote, "collection-id", NULL,
&remote_collection_id, NULL))