From 164269a2dae3b15c37a319e43b5fc38d9bcd2038 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 18 Nov 2013 11:48:00 +0000 Subject: [PATCH] Malloc cannot accept a negative number so check 'num' parameter before calling malloc. Fixes Coverity CID1039352 Signed-off-by: Chris Michael --- src/lib/ecore_con/ecore_con.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cl->host_server->event_count = eina_list_append(cl->host_server->event_count, e); _ecore_con_cl_timer_update(cl); e->client = cl; - if (duplicate) + if ((duplicate) && (num > 0)) { e->data = malloc(num); if (!e->data)