aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/ipc.c
diff options
context:
space:
mode:
authorSimon Busch <morphis@gravedo.de>2012-11-13 16:53:27 +0100
committerSimon Busch <morphis@gravedo.de>2012-11-14 06:57:15 +0100
commit1c46f2f4e6d462799878844344860e836cae4b3f (patch)
tree95365164bee60e83e9a74f439b163d589a3eb293 /samsung-ipc/ipc.c
parent9574ecec486a4ebd2be962838cad3fb1b91bb078 (diff)
downloadexternal_libsamsung-ipc-1c46f2f4e6d462799878844344860e836cae4b3f.zip
external_libsamsung-ipc-1c46f2f4e6d462799878844344860e836cae4b3f.tar.gz
external_libsamsung-ipc-1c46f2f4e6d462799878844344860e836cae4b3f.tar.bz2
ipc: reset client structure after allocation to zero
When we're just allocating memory and do not care about the content of the allocated memory area we can head into cases where the internal parts of the structures are already set with a random value and then causes segfaults cause code peaces are trying to access invalid memory areas. Signed-off-by: Simon Busch <morphis@gravedo.de>
Diffstat (limited to 'samsung-ipc/ipc.c')
-rw-r--r--samsung-ipc/ipc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index 68e9ec9..b6b6b1b 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -157,6 +157,8 @@ struct ipc_client* ipc_client_new(int client_type)
return NULL;
client = (struct ipc_client*) malloc(sizeof(struct ipc_client));
+ memset(client, 0, sizeof(struct ipc_client));
+
client->type = client_type;
switch (client_type)