avoid passing NULL to memcpy
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Jan 2011 02:35:59 +0000 (02:35 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Jan 2011 02:35:59 +0000 (02:35 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@56083 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con_info.c

index a1dad6b..8e40629 100644 (file)
@@ -262,9 +262,10 @@ ecore_con_info_get(Ecore_Con_Server *svr,
              memcpy(tosend + sizeof(Ecore_Con_Info),
                     result->ai_addr,
                     result->ai_addrlen);
-             memcpy(tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen,
-                    result->ai_canonname,
-                    canonname_len);
+             if (result->ai_canonname) /* FIXME: else... */
+               memcpy(tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen,
+                      result->ai_canonname,
+                      canonname_len);
 
              if (!getnameinfo(result->ai_addr, result->ai_addrlen,
                               hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),