Blame SOURCES/0003-appchooserdialog-add-g_return-to-show_more.patch

32b021
From 34db1404382cebbfbf170cfba53371d465c1668f Mon Sep 17 00:00:00 2001
32b021
From: Michael Catanzaro <mcatanzaro@gnome.org>
32b021
Date: Wed, 6 May 2020 10:57:29 -0500
32b021
Subject: [PATCH 3/4] appchooserdialog: add g_return to show_more()
32b021
32b021
We should never get here unless there are more desktop file choices than
32b021
the initial list size. We never do; this assertion is just here to
32b021
clarify this. (Otherwise, we could have a buffer overrun in the loop
32b021
below.)
32b021
32b021
(cherry picked from commit 878c06a525b05315fe56baae59c19bfd714df638)
32b021
---
32b021
 src/appchooserdialog.c | 2 ++
32b021
 1 file changed, 2 insertions(+)
32b021
32b021
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
32b021
index b779f43..c0eb4ca 100644
32b021
--- a/src/appchooserdialog.c
32b021
+++ b/src/appchooserdialog.c
32b021
@@ -132,6 +132,8 @@ show_more (AppChooserDialog *dialog)
32b021
   gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
32b021
   gtk_widget_hide (dialog->more_row);
32b021
 
32b021
+  g_return_if_fail (g_strv_length ((char **)dialog->choices) > INITIAL_LIST_SIZE);
32b021
+
32b021
   for (i = INITIAL_LIST_SIZE; dialog->choices[i]; i++)
32b021
     {
32b021
       g_autofree char *desktop_id = g_strconcat (dialog->choices[i], ".desktop", NULL);
32b021
-- 
32b021
2.26.2
32b021