gvfs r2043 - in trunk: . daemon



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

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

	Patch from Andreas Henriksson

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



Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendftp.c

Modified: trunk/daemon/gvfsbackendftp.c
==============================================================================
--- trunk/daemon/gvfsbackendftp.c	(original)
+++ trunk/daemon/gvfsbackendftp.c	Mon Oct  6 12:22:53 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]