[sr-dev] git:master:0fd33d76: imc: better check for buffer size limit
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jul 27 11:35:23 CEST 2017
Module: kamailio
Branch: master
Commit: 0fd33d766c471e0f0710bd6f84898462420bfbaa
URL: https://github.com/kamailio/kamailio/commit/0fd33d766c471e0f0710bd6f84898462420bfbaa
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-27T11:34:35+02:00
imc: better check for buffer size limit
---
Modified: src/modules/imc/imc.c
Modified: src/modules/imc/imc_cmd.c
---
Diff: https://github.com/kamailio/kamailio/commit/0fd33d766c471e0f0710bd6f84898462420bfbaa.diff
Patch: https://github.com/kamailio/kamailio/commit/0fd33d766c471e0f0710bd6f84898462420bfbaa.patch
---
diff --git a/src/modules/imc/imc.c b/src/modules/imc/imc.c
index 8876b248a1..2ae31c997c 100644
--- a/src/modules/imc/imc.c
+++ b/src/modules/imc/imc.c
@@ -304,11 +304,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;
diff --git a/src/modules/imc/imc_cmd.c b/src/modules/imc/imc_cmd.c
index 781bf57cfe..1514e2c956 100644
--- a/src/modules/imc/imc_cmd.c
+++ b/src/modules/imc/imc_cmd.c
@@ -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;
More information about the sr-dev
mailing list