Skip to content

Commit

Permalink
rabbitmq: fix crash in case of bad parameter for rmq_publish
Browse files Browse the repository at this point in the history
Fixes Coverity CID #199894
  • Loading branch information
rvlad-patrascu committed Jul 16, 2020
1 parent 1319c47 commit e7ba585
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/rabbitmq/rmq_servers.c
Expand Up @@ -517,13 +517,16 @@ int rmq_server_add(modparam_t type, void * val)
*/
int fixup_rmq_server(void **param)
{
*param = rmq_get_server((str*)*param);
if (!(*param)) {
void *srv = rmq_get_server((str*)*param);

if (!srv) {
LM_ERR("unknown connection id=%.*s\n",
((str*)*param)->len, ((str*)*param)->s);
return E_CFG;
}

*param = srv;

return 0;
}

Expand Down

0 comments on commit e7ba585

Please sign in to comment.