mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-29 10:01:18 -05:00
common/dir: Avoid a potential NULL pointer dereference
Everywhere else that index->manifests is used, it’s checked for being NULL beforehand, which probably means that, sometimes, it might be NULL. Let’s check that here too. Coverity issue: 1452432 Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -6612,7 +6612,8 @@ flatpak_dir_remote_make_oci_summary (FlatpakDir *self,
|
||||
additional_metadata_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
|
||||
|
||||
/* The summary has to be sorted by ref, so pre-sort the manifests */
|
||||
qsort (index->manifests, flatpak_oci_index_get_n_manifests (index), sizeof (FlatpakOciManifestDescriptor *), compare_mdp);
|
||||
if (index->manifests != NULL)
|
||||
qsort (index->manifests, flatpak_oci_index_get_n_manifests (index), sizeof (FlatpakOciManifestDescriptor *), compare_mdp);
|
||||
|
||||
for (i = 0; index->manifests != NULL && index->manifests[i] != NULL; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user