summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2010-03-09 16:07:18 -0800
committerFederico Mena Quintero <federico@novell.com>2010-08-25 12:14:22 -0500
commit620d3405747cf2a0546f6ea4a7f2cbc8fd534122 (patch)
tree59461c511dd74fc9a93b3bc784f05d5fae68db99
parent64b78616ad4ecd0d625be8bfe9f49a38781a78c6 (diff)
downloadgtk+-620d3405747cf2a0546f6ea4a7f2cbc8fd534122.tar.gz
Validate the results in gtk_file_chooser_get_files.
-rw-r--r--gtk/gtkfilechooser.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 905b21eb10..d0d5003603 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -1815,9 +1815,21 @@ gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
GSList *
gtk_file_chooser_get_files (GtkFileChooser *chooser)
{
+ GSList *files, *l;
+
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
- return GTK_FILE_CHOOSER_GET_IFACE (chooser)->get_files (chooser);
+ files = GTK_FILE_CHOOSER_GET_IFACE (chooser)->get_files (chooser);
+
+ for (l = files; l != NULL; l = l->next)
+ {
+ GFile *file = (GFile *)l->data;
+
+ g_return_val_if_fail (_gtk_file_chooser_is_file_in_root (chooser, file),
+ NULL);
+ }
+
+ return files;
}
/**