ecore-con - fix explicit null dereference
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 27 Aug 2014 08:16:17 +0000 (17:16 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 27 Aug 2014 08:16:17 +0000 (17:16 +0900)
fix CID 1232731

src/lib/ecore_con/ecore_con.c

index d9237ec7223d954b4ab727d55cfe060eac48f231..14db25395c69db4fc8f24e4da49774440df536fc 100644 (file)
@@ -760,7 +760,8 @@ _ecore_con_client_ecore_con_base_send(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data
              cl->buf = eina_binbuf_new();
              EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0);
 #ifdef TCP_CORK
-             if ((cl->fd >= 0) && ((host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
+             if ((cl->fd >= 0) && (host_server->type) &&
+                 ((host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
                {
                   int state = 1;
                   if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)