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)
downloadlibplist-1e304d42f0884c5ea3162e34ce27eba11c1e74f0.tar.gz
libplist-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)
g_io_channel_shutdown(file, TRUE, NULL);
/* append device to list */
- gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 1));
+ gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 2));
int i;
for( i = 0; i < length; i++)
new_devices_list[i] = devices_list[i];