Commit cfa794a5 authored by Pekka Pessi's avatar Pekka Pessi

nea_server.c: fix argument checks in nea_event_tcreate()

MeeGo Coverity issue CID #11756
parent 56be3429
......@@ -1219,7 +1219,6 @@ nea_event_t *nea_event_tcreate(nea_server_t *nes,
tag_type_t tag, tag_value_t value, ...)
{
nea_event_t *ev, **pev;
size_t len = strlen(name);
ta_list ta;
if (nes == NULL || callback == NULL || name == NULL)
......@@ -1235,6 +1234,11 @@ nea_event_t *nea_event_tcreate(nea_server_t *nes,
}
}
else {
size_t len = strlen(name);
if (len == 0)
return NULL;
for (pev = &nes->nes_events; (ev = *pev); pev = &(*pev)->ev_next) {
if (strncmp(ev->ev_event->o_type, name, len) != 0 ||
ev->ev_event->o_type[len] != '.' ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment