diff --git a/ChangeLog b/ChangeLog
index 0941ec0..97ee40d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-06-22  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
+
+	* glib/gstring.c: Use memcpy in g_string_append_vprintf (#57693).
+
 2007-06-18  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
 
 	* glib/gstring.c: Restore old behaviour of 
diff --git a/glib/gstring.c b/glib/gstring.c
index f8cc7da..aeaf1d2 100644
--- a/glib/gstring.c
+++ b/glib/gstring.c
@@ -1278,15 +1278,21 @@ g_string_append_vprintf (GString     *string,
 			 const gchar *fmt,
 			 va_list      args)
 {
-  gchar *buffer;
-  gint length;
+  gchar *buf;
+  gint len;
   
   g_return_if_fail (string != NULL);
   g_return_if_fail (fmt != NULL);
 
-  length = g_vasprintf (&buffer, fmt, args);
-  g_string_append_len (string, buffer, length);
-  g_free (buffer);
+  len = g_vasprintf (&buf, fmt, args);
+
+  if (len >= 0)
+    {
+      g_string_maybe_expand (string, len);
+      memcpy (string->str + string->len, buf, len + 1);
+      string->len += len;
+      g_free (buf);
+    }
 }
 
 /**
