diff options
author | Chris Michael <cp.michael@samsung.com> | 2013-11-18 11:48:00 +0000 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2013-11-18 11:50:42 +0000 |
commit | 164269a2dae3b15c37a319e43b5fc38d9bcd2038 (patch) | |
tree | 5b227979520eb594f7c870dfaeeca2e23ceae12f | |
parent | de135600565624f44f49e55164f9439e0ca55219 (diff) |
Malloc cannot accept a negative number so check 'num' parameter before
calling malloc.
Fixes Coverity CID1039352
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/lib/ecore_con/ecore_con.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index fece5f30d6..d28a84582a 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c | |||
@@ -1176,7 +1176,7 @@ ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int num, E | |||
1176 | cl->host_server->event_count = eina_list_append(cl->host_server->event_count, e); | 1176 | cl->host_server->event_count = eina_list_append(cl->host_server->event_count, e); |
1177 | _ecore_con_cl_timer_update(cl); | 1177 | _ecore_con_cl_timer_update(cl); |
1178 | e->client = cl; | 1178 | e->client = cl; |
1179 | if (duplicate) | 1179 | if ((duplicate) && (num > 0)) |
1180 | { | 1180 | { |
1181 | e->data = malloc(num); | 1181 | e->data = malloc(num); |
1182 | if (!e->data) | 1182 | if (!e->data) |