summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Bastien Nocera2009-08-01 15:02:39 +0100
committerGravatar Matt Colyer2009-08-03 08:58:33 -0700
commiteb5d285ed474f0cc20b968e4a5d590a3b35e52a7 (patch)
treed6f54b7911d1dbd54058ec40da8cb335db5eddba /src
parent4b8e5ac804896c821a867a378c17727c61ec0373 (diff)
downloadlibimobiledevice-eb5d285ed474f0cc20b968e4a5d590a3b35e52a7.tar.gz
libimobiledevice-eb5d285ed474f0cc20b968e4a5d590a3b35e52a7.tar.bz2
Avoid invalid memory accesses in lockdownd_client_new()
Valgrind complains: ==2678== Conditional jump or move depends on uninitialised value(s) ==2678== at 0x3ACD40646C: lockdownd_client_new (lockdown.c:662) ==2678== by 0x405BA6: g_vfs_afc_volume_new (afc-volume.c:113) ==2678== by 0x406541: g_vfs_afc_monitor_device_added (afc-volume-monitor.c:46) ==2678== by 0x4066B1: g_vfs_afc_volume_monitor_constructor (afc-volume-monitor.c:173) ==2678== by 0x3A7FE11A38: g_object_newv (in /lib64/libgobject-2.0.so.0.2000.4) ==2678== by 0x3A7FE12584: g_object_new_valist (in /lib64/libgobject-2.0.so.0.2000.4) ==2678== by 0x3A7FE126DB: g_object_new (in /lib64/libgobject-2.0.so.0.2000.4) ==2678== by 0x408AD5: monitor_try_create (gvfsproxyvolumemonitordaemon.c:1651) ==2678== by 0x408C20: g_vfs_proxy_volume_monitor_daemon_main (gvfsproxyvolumemonitordaemon.c:1694) ==2678== by 0x37E881EA2C: (below main) (in /lib64/libc-2.10.1.so) ==2678== Uninitialised value was created by a stack allocation ==2678== at 0x405B00: g_vfs_afc_volume_new (afc-volume.c:138)
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 88ab7b0..7a2aa7d 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -659,7 +659,7 @@ lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **de
*/
lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client)
{
- if (!device || !client || (client && *client))
+ if (!device || !client)
return LOCKDOWN_E_INVALID_ARG;
lockdownd_error_t ret = LOCKDOWN_E_SUCCESS;
char *host_id = NULL;