ecore_con: add check for invalid space("") name

Summary:
space("") name check had existed, but it was removed on f4306d654d
(in the _efl_network_connector_efl_object_finalize)
This patch restore the safety checks

Reviewers: barbieri, Hermet, Jaehyun_Cho, myoungwoon, zmike

Reviewed By: zmike

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6177
This commit is contained in:
YeongJong Lee 2018-05-18 13:47:03 -04:00 committed by Mike Blumenkrantz
parent 27316746f5
commit 6fdc3794eb
1 changed files with 3 additions and 1 deletions

View File

@ -939,6 +939,8 @@ ecore_con_server_check(const Ecore_Con_Server *svr)
static Ecore_Con_Server *
_ecore_con_server_new(Eina_Bool is_dialer, Ecore_Con_Type type, const char *name, int port, const void *data)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(!name || (!name[0]), NULL);
Ecore_Con_Server *svr = calloc(1, sizeof(Ecore_Con_Server));
EINA_SAFETY_ON_NULL_RETURN_VAL(svr, NULL);
svr->start_time = ecore_time_get();
@ -2630,7 +2632,7 @@ ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done_cb, const void *data)
.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED | AI_CANONNAME,
};
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(!name || (!name[0]), EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, EINA_FALSE);
ctx = malloc(sizeof(Ecore_Con_Lookup_Ctx));