Skip to content

Commit

Permalink
usrloc: get_udomain() - safety checks for location table name parameter
Browse files Browse the repository at this point in the history
(cherry picked from commit 29dde9f)
  • Loading branch information
miconda authored and henningw committed Oct 2, 2020
1 parent 1d0f0bc commit 3ce17b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/modules/usrloc/dlist.c
Expand Up @@ -597,13 +597,24 @@ int get_udomain(const char* _n, udomain_t** _d)
dlist_t* d;
str s;

if(_n == NULL) {
LM_ERR("null location table name\n");
goto notfound;
}

s.s = (char*)_n;
s.len = strlen(_n);
if(s.len <= 0) {
LM_ERR("empty location table name\n");
goto notfound;
}

if (find_dlist(&s, &d) == 0) {
*_d = d->d;
return 0;
}

notfound:
*_d = NULL;
return -1;
}
Expand Down

0 comments on commit 3ce17b3

Please sign in to comment.