Skip to content

Commit

Permalink
imc: better check for buffer size limit
Browse files Browse the repository at this point in the history
(cherry picked from commit 0fd33d7)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent f62f383 commit 6872ead
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions src/modules/imc/imc.c
Expand Up @@ -303,11 +303,6 @@ int add_from_db(void)
imc_dbf.free_result(imc_db, r_res);
r_res = NULL;
}
if(m_res)
{
imc_dbf.free_result(imc_db, m_res);
m_res = NULL;
}

return 0;

Expand Down
3 changes: 1 addition & 2 deletions src/modules/imc/imc_cmd.c
Expand Up @@ -467,8 +467,7 @@ int imc_handle_invite(struct sip_msg* msg, imc_cmd_t *cmd,
}

body.len = 13 + member->uri.len - 4/* sip: */ + 28;
if(body.len>=IMC_BUF_SIZE || member->uri.len>=IMC_BUF_SIZE
|| room->uri.len>=IMC_BUF_SIZE)
if(body.len>=IMC_BUF_SIZE-1)
{
LM_ERR("buffer size overflow\n");
goto error;
Expand Down

0 comments on commit 6872ead

Please sign in to comment.