diff options
author | Simon Busch <morphis@gravedo.de> | 2012-11-13 16:53:27 +0100 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2012-11-14 06:57:15 +0100 |
commit | 1c46f2f4e6d462799878844344860e836cae4b3f (patch) | |
tree | 95365164bee60e83e9a74f439b163d589a3eb293 | |
parent | 9574ecec486a4ebd2be962838cad3fb1b91bb078 (diff) | |
download | external_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>
-rw-r--r-- | samsung-ipc/ipc.c | 2 |
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) |