From 1e304d42f0884c5ea3162e34ce27eba11c1e74f0 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sun, 10 Aug 2008 22:58:01 +0200 Subject: Fix buffer overflow Signed-off-by: Matt Colyer --- src/userpref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/userpref.c') 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]; -- cgit v1.1-32-gdbae