mirror of
https://github.com/flatpak/flatpak.git
synced 2026-09-22 13:15:53 -04: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:
1 parent
ecbf42d7fa
commit
c157719616
1 file changed
+2
-1
@@ -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