Module: kamailio
Branch: master
Commit: 55bf58d81dc5033efa5d0239a85574ff1a58782a
URL:
https://github.com/kamailio/kamailio/commit/55bf58d81dc5033efa5d0239a85574f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-03-07T16:46:28+01:00
Merge pull request #534 from athonet-open/fix_tel2sip
siputils: tel2sip(): fix 'off by one' when allocating memory
---
Modified: modules/siputils/checks.c
---
Diff:
https://github.com/kamailio/kamailio/commit/55bf58d81dc5033efa5d0239a85574f…
Patch:
https://github.com/kamailio/kamailio/commit/55bf58d81dc5033efa5d0239a85574f…
---
diff --git a/modules/siputils/checks.c b/modules/siputils/checks.c
index a44c066..963032c 100644
--- a/modules/siputils/checks.c
+++ b/modules/siputils/checks.c
@@ -374,7 +374,7 @@ int tel2sip(struct sip_msg* _msg, char* _uri, char* _hostpart, char*
_res)
/* reserve memory for resulting sip uri */
sip_uri.len = 4 + tel_uri.len - 4 + 1 + hostpart.len + 1 + 10;
- sip_uri.s = pkg_malloc(sip_uri.len);
+ sip_uri.s = pkg_malloc(sip_uri.len+1);
if (sip_uri.s == 0) {
LM_ERR("no more pkg memory\n");
pkg_free(tel_uri.s);