gvfs r2044 - in branches/gnome-2-24: . daemon



Author: alexl
Date: Mon Oct  6 12:24:18 2008
New Revision: 2044
URL: http://svn.gnome.org/viewvc/gvfs?rev=2044&view=rev

Log:
2008-10-06  Alexander Larsson  <alexl redhat com>

	Patch from Andreas Henriksson (from trunk)

        * daemon/gvfsbackendftp.c:
        (dir_default_iter_new):
        (dir_default_iter_process):
	Don't read past start of filename. (#545971)



Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/daemon/gvfsbackendftp.c

Modified: branches/gnome-2-24/daemon/gvfsbackendftp.c
==============================================================================
--- branches/gnome-2-24/daemon/gvfsbackendftp.c	(original)
+++ branches/gnome-2-24/daemon/gvfsbackendftp.c	Mon Oct  6 12:24:18 2008
@@ -979,7 +979,7 @@
 static gpointer
 dir_default_iter_new (FtpConnection *conn)
 {
-  return g_slice_new (struct list_state);
+  return g_slice_new0 (struct list_state);
 }
 
 static GFileInfo *
@@ -1062,9 +1062,15 @@
 	      char *end = str + 4;
 	      char *start;
 	      start = str - 1;
-	      while (*start != '/')
+	      while (start >= symlink_file && *start != '/')
 		start--;
-	      memcpy (start + 1, end, strlen (end) + 1);
+
+	      if (start < symlink_file) {
+		      *symlink_file = '/';
+		      start = symlink_file;
+	      }
+
+	      memmove (start + 1, end, strlen (end) + 1);
 	    }
 	  str = symlink_file + strlen (symlink_file) - 1;
 	  while (*str == '/' && str > symlink_file)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]