[gnome-bluetooth/wip/jtojnar/sendto-fix: 2/2] sendto: Fix out of bounds access
- From: Jan Tojnar <jtojnar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/jtojnar/sendto-fix: 2/2] sendto: Fix out of bounds access
- Date: Tue, 22 Feb 2022 10:53:28 +0000 (UTC)
commit f4ba14f0c759e0a458bb3f4d0aadfd72d1b59d2b
Author: Jan Tojnar <jtojnar gmail com>
Date: Tue Feb 22 11:19:25 2022 +0100
sendto: Fix out of bounds access
When running `bluetooth-sendto` without arguments and selecting some files,
the app would try to access memory after the model list returned by gtk_file_chooser_get_files.
sendto/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/sendto/main.c b/sendto/main.c
index 42f2c749..ead4c227 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -712,7 +712,7 @@ show_select_dialog(void)
files = g_new(gchar *, g_list_model_get_n_items(selected_files) + 1);
- for (i = 0; g_list_model_get_n_items(selected_files); i++) {
+ for (i = 0; i < g_list_model_get_n_items(selected_files); i++) {
g_autoptr(GFile) file = g_list_model_get_item(selected_files, i);
files[i] = g_file_get_path(file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]