commit 46a7a8cbeb36aeb8e9f9eb619105403063a3ccb7
parent 49849510a9cb99e854ac5e2ce9abf486806054a5
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 13 Dec 2024 15:32:33 +0100
-check return values, other minor bugs
Diffstat:
4 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c
@@ -1473,12 +1473,12 @@ action_secret_editing (void)
true);
if (0 != strcmp (old,
NULL != text
- ? text
- : ""))
+ ? text
+ : ""))
gtk_text_buffer_set_text (tb,
NULL != text
- ? text
- : "",
+ ? text
+ : "",
-1);
}
update_label ("anastasis_gtk_secret_file_name_label",
@@ -2182,9 +2182,10 @@ long_poll_providers_action_cb (void *cls,
ap = json_object_get (response,
"authentication_providers");
ns = json_incref (AG_redux_state);
- json_object_set (ns,
- "authentication_providers",
- ap);
+ GNUNET_assert (0 ==
+ json_object_set (ns,
+ "authentication_providers",
+ ap));
AG_action_cb (NULL,
TALER_EC_NONE,
ns);
diff --git a/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c b/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c
@@ -170,9 +170,13 @@ provider_toggle_callback (GtkCellRendererToggle *cell,
return;
}
path = gtk_tree_path_new_from_string (path_str);
- gtk_tree_model_get_iter (tm,
- &iter,
- path);
+ if (! gtk_tree_model_get_iter (tm,
+ &iter,
+ path))
+ {
+ GNUNET_break (0);
+ return;
+ }
gtk_tree_model_get (tm,
&iter,
AG_PMC_PROVIDER_ENABLED, &enabled,
diff --git a/src/anastasis/anastasis-gtk_handle-method-totp.c b/src/anastasis/anastasis-gtk_handle-method-totp.c
@@ -91,9 +91,10 @@ compute_totp (int time_off)
gcry_md_open (&md,
GCRY_MD_SHA1,
GCRY_MD_FLAG_HMAC));
- gcry_md_setkey (md,
- totp_key,
- sizeof (totp_key));
+ GNUNET_assert (GPG_ERR_NO_ERROR ==
+ gcry_md_setkey (md,
+ totp_key,
+ sizeof (totp_key)));
gcry_md_write (md,
&ctr,
sizeof (ctr));
diff --git a/src/anastasis/anastasis-gtk_progress.c b/src/anastasis/anastasis-gtk_progress.c
@@ -34,7 +34,8 @@
gboolean
anastasis_gtk_backup_progress_treeview_button_press_event_cb (GtkWidget *widget,
GdkEvent *event,
- gpointer user_data)
+ gpointer user_data
+ )
{
return TRUE;
}
@@ -113,16 +114,21 @@ AG_progress_update (void)
return;
}
ts = GTK_TREE_SELECTION (GCG_get_main_window_object (
- "anastasis_gtk_recovery_progress_tree_selection"));
+ "anastasis_gtk_recovery_progress_tree_selection")
+ );
}
else
{
ts = GTK_TREE_SELECTION (GCG_get_main_window_object (
"anastasis_gtk_backup_progress_tree_selection"));
}
- gtk_tree_selection_get_selected (ts,
- &tm,
- &iter);
+ if (! gtk_tree_selection_get_selected (ts,
+ &tm,
+ &iter))
+ {
+ GNUNET_break (0);
+ return;
+ }
if (! gtk_tree_model_get_iter_first (tm,
&iter))
{