diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 09:54:35 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 09:54:35 +0200 |
commit | b8549e858da5300cff4cc9fda7162692346612b1 (patch) | |
tree | e50e4ea5d07510f6d94625785c6dc52bf918cd73 | |
parent | 1d3d33e7c300fa627823d50151dbeba835540d3e (diff) | |
download | edoors-b8549e858da5300cff4cc9fda7162692346612b1.zip edoors-b8549e858da5300cff4cc9fda7162692346612b1.tar.gz |
eiotas_iota_init: check for not NULL or empty name parameter
-rw-r--r-- | src/lib/eiotas_iota.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |