pull: Add assertions to quiet clang-analyzer
authorColin Walters <walters@verbum.org>
Sat, 26 Aug 2023 16:23:36 +0000 (12:23 -0400)
committerColin Walters <walters@verbum.org>
Sat, 26 Aug 2023 16:24:10 +0000 (12:24 -0400)
It's warning the value can be NULL, but I don't think that's true.
I believe we're just hitting analysis limit (the path length is 119).

src/libostree/ostree-repo-pull.c

index 517c426facec10b3cdb3c64ce83ad740b10bb003..3e461e33702a95536bc25a1040169da52933b271 100644 (file)
@@ -784,7 +784,7 @@ fetch_ref_contents (OtPullData *pull_data, const char *main_collection_id,
                                                   filename, pull_data->n_network_retries,
                                                   &ret_contents, cancellable, error))
         return FALSE;
-
+      g_assert (ret_contents);
       g_strchomp (ret_contents);
     }
 
@@ -1951,6 +1951,7 @@ load_remote_repo_config (OtPullData *pull_data, GKeyFile **out_keyfile, GCancell
                                               "config", pull_data->n_network_retries, &contents,
                                               cancellable, error))
     return FALSE;
+  g_assert (contents);
 
   g_autoptr (GKeyFile) ret_keyfile = g_key_file_new ();
   if (!g_key_file_load_from_data (ret_keyfile, contents, strlen (contents), 0, error))