Skip to content

Commit

Permalink
src/manifest: check input params in parse_manifest()
Browse files Browse the repository at this point in the history
Replace g_assert() by g_return_val_if_fail() and extend it on all input
params.

Signed-off-by: Enrico Joerns <[email protected]>
  • Loading branch information
ejoerns committed Mar 2, 2022
1 parent 9f07e75 commit 39a0c7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ static gboolean parse_manifest(GKeyFile *key_file, RaucManifest **manifest, GErr
g_auto(GStrv) bundle_hooks = NULL;
gsize hook_entries;

g_assert_null(*manifest);
g_return_val_if_fail(key_file != NULL, FALSE);
g_return_val_if_fail(manifest != NULL && *manifest == NULL, FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);

/* parse [update] section */
raucm->update_compatible = key_file_consume_string(key_file, "update", "compatible", &ierror);
Expand Down

0 comments on commit 39a0c7a

Please sign in to comment.