[gimp] app: check top_directory for plausibility
- From: Nils Philippsen <nphilipp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: check top_directory for plausibility
- Date: Fri, 10 Feb 2012 15:21:32 +0000 (UTC)
commit 3a151bd1a974281c75611ef800e41cbbca7b9015
Author: Nils Philippsen <nils redhat com>
Date: Fri Feb 10 15:17:09 2012 +0100
app: check top_directory for plausibility
app/core/gimpdata.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c
index 6beefe7..27eaa3e 100644
--- a/app/core/gimpdata.c
+++ b/app/core/gimpdata.c
@@ -884,6 +884,12 @@ gimp_data_set_folder_tags (GimpData *data,
*/
if (top_directory)
{
+ size_t top_directory_len = strlen (top_directory);
+
+ g_return_if_fail (g_str_has_prefix (dirname, top_directory)
+ && (dirname[top_directory_len] == '\0'
+ || G_IS_DIR_SEPARATOR (dirname[top_directory_len])));
+
do
{
gchar *basename = g_path_get_basename (dirname);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]