From: Enlightenment S. <no-...@en...> - 2011-01-08 06:04:39
|
Log: fix segv when using udisks to mount during ipc reads Author: discomfitor Date: 2011-01-07 22:04:32 -0800 (Fri, 07 Jan 2011) New Revision: 55989 Trac: http://trac.enlightenment.org/e/changeset/55989 Modified: trunk/e/src/bin/e_fm.c trunk/e/src/bin/e_fm_device.c Modified: trunk/e/src/bin/e_fm.c =================================================================== --- trunk/e/src/bin/e_fm.c 2011-01-08 05:55:25 UTC (rev 55988) +++ trunk/e/src/bin/e_fm.c 2011-01-08 06:04:32 UTC (rev 55989) @@ -3000,10 +3000,11 @@ if ((e->data) && (e->size > 1)) { E_Volume *v; - char *udi, *mountpoint; + char *udi, *mountpoint = NULL; udi = e->data; - mountpoint = udi + strlen(udi) + 1; + if ((unsigned int)e->size != (strlen(udi) + 1)) + mountpoint = udi + strlen(udi) + 1; v = e_fm2_device_volume_find(udi); if (v) { @@ -3016,7 +3017,7 @@ a = e_action_find("fileman"); m = e_manager_list(); - if (a && a->func.go && m && eina_list_data_get(m)) + if (a && a->func.go && m && eina_list_data_get(m) && mountpoint) a->func.go(E_OBJECT(eina_list_data_get(m)), mountpoint); } } Modified: trunk/e/src/bin/e_fm_device.c =================================================================== --- trunk/e/src/bin/e_fm_device.c 2011-01-08 05:55:25 UTC (rev 55988) +++ trunk/e/src/bin/e_fm_device.c 2011-01-08 06:04:32 UTC (rev 55989) @@ -421,12 +421,8 @@ E_Fm2_Mount *m; v->mounted = EINA_TRUE; - if (mountpoint && (*mountpoint != 0)) - { - if (v->mount_point) - eina_stringshare_del(v->mount_point); - v->mount_point = eina_stringshare_add(mountpoint); - } + if (mountpoint && (mountpoint[0])) + eina_stringshare_replace(&v->mount_point, mountpoint); EINA_LIST_FOREACH(v->mounts, l, m) _e_fm2_device_mount_ok(m); |