commit 66b1a64edcdb8afc20394a0727a1c194af254b76
Author: phantomjinx <[email protected]>
Date: Tue Dec 28 22:23:07 2010 +0000
Attempted fix for segfault due to escape string in uri
* autodetection.c
* Would appear that ipod names that include an apostrophe, eg. Kyle's ipod,
have a problem being escaped to uri type strings, ie. 's changed
to %27s. Printing this string in warning messages segfaults gtkpod
since it is considered a format string.
* Using the non-uri string for all print statements should avoid this
rather specific problem.
libgtkpod/autodetection.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libgtkpod/autodetection.c b/libgtkpod/autodetection.c
index d29ee5d..efe5a0e 100644
--- a/libgtkpod/autodetection.c
+++ b/libgtkpod/autodetection.c
@@ -216,10 +216,9 @@ static gboolean ad_timeout_cb(gpointer data) {
GFile *muri = g_file_parse_name(mount_uri);
mountpoint = g_file_get_path(muri);
g_object_unref(muri);
- g_free(mount_uri);
if (mountpoint) {
- debug ("Mounted iPod at '%s'\n", mountpoint);
+ debug ("Mounted iPod at '%s'\n", mount_uri);
itdb = ad_find_repository_with_mountpoint(mountpoint);
}
@@ -241,11 +240,11 @@ static gboolean ad_timeout_cb(gpointer data) {
set_itdb_prefs_int(loaded_itdb, "type",
loaded_itdb->usertype);
}
else {
- gtkpod_warning(_("Newly mounted iPod at '%s' could not
be loaded into gtkpod.\n\n"), mountpoint);
+ gtkpod_warning(_("Newly mounted iPod at '%s' could not
be loaded into gtkpod.\n\n"), mount_uri);
}
}
else {
- gtkpod_warning(_("Newly mounted iPod at '%s' appears to be
already loaded!\n\n"), mountpoint);
+ gtkpod_warning(_("Newly mounted iPod at '%s' appears to be
already loaded!\n\n"), mount_uri);
} debug ("...OK (used)\n");
}
else { /* Set up new itdb (which we'll add to the end of the list)
*/
@@ -272,6 +271,7 @@ static gboolean ad_timeout_cb(gpointer data) {
release_widgets();
g_free(mountpoint);
+ g_free(mount_uri);
g_mutex_lock (ad->mutex);
}
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2