From 50835cccfde7f50e7e2d076d54758324d01b203b Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 2 Jun 2022 20:10:40 +0200 Subject: [PATCH] utils: Avoid passing a potentially NULL pointer to strlen(3) --- common/flatpak-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index 0e6b028f..93fa14de 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -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))