From b8549e858da5300cff4cc9fda7162692346612b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 22 May 2012 09:54:35 +0200 Subject: eiotas_iota_init: check for not NULL or empty name parameter --- src/lib/eiotas_iota.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/eiotas_iota.c b/src/lib/eiotas_iota.c index 11560c8..ea0f103 100644 --- a/src/lib/eiotas_iota.c +++ b/src/lib/eiotas_iota.c @@ -32,11 +32,16 @@ int eiotas_iota_init(Eiotas_Iota *iota, const char *name, Eiotas_Iota *parent, E int ln, lp; char tmp[MAX_PATH_LENGTH]; + ln = strlen(name); + if(name==NULL || ln==0) { + ERR("name can't be NULL or empty"); + return 1; + } + iota->type = type; iota->spin = ( parent ? parent->spin : iota ); iota->parent = parent; if(parent) { - ln = strlen(name); lp = eina_stringshare_strlen(parent->path); if((ln+lp+2)>MAX_PATH_LENGTH) { ERR("path length %d is > MAX_PATH_LENGTH (%d)",(ln+lp+2),MAX_PATH_LENGTH); -- cgit v1.1-2-g2b99