summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-10 22:58:01 +0200
committerGravatar Matt Colyer2008-08-11 09:35:15 -0700
commit1e304d42f0884c5ea3162e34ce27eba11c1e74f0 (patch)
tree849ceaa0763688fb2110a4e94ad858308520d95d
parent1c920f3c8ec3466d23ba0d1ac417793d406cb11b (diff)
downloadlibimobiledevice-1e304d42f0884c5ea3162e34ce27eba11c1e74f0.tar.gz
libimobiledevice-1e304d42f0884c5ea3162e34ce27eba11c1e74f0.tar.bz2
Fix buffer overflow
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r--src/userpref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/userpref.c b/src/userpref.c
index f4a22fd..cd29c43 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -140,7 +140,7 @@ int store_device_public_key(char* public_key)
140 g_io_channel_shutdown(file, TRUE, NULL); 140 g_io_channel_shutdown(file, TRUE, NULL);
141 141
142 /* append device to list */ 142 /* append device to list */
143 gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 1)); 143 gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 2));
144 int i; 144 int i;
145 for( i = 0; i < length; i++) 145 for( i = 0; i < length; i++)
146 new_devices_list[i] = devices_list[i]; 146 new_devices_list[i] = devices_list[i];