[sr-dev] git:master:644b8710: siputils: tel2sip(): fix 'off by one' when allocating memory
Dragos Oancea
dragos.oancea at athonet.com
Mon Mar 7 16:46:32 CET 2016
Module: kamailio
Branch: master
Commit: 644b87109321d6a6724cc82336289d17814173f2
URL: https://github.com/kamailio/kamailio/commit/644b87109321d6a6724cc82336289d17814173f2
Author: Dragos Oancea <dragos.oancea at athonet.com>
Committer: Dragos Oancea <dragos.oancea at athonet.com>
Date: 2016-03-07T15:10:32+01:00
siputils: tel2sip(): fix 'off by one' when allocating memory
---
Modified: modules/siputils/checks.c
---
Diff: https://github.com/kamailio/kamailio/commit/644b87109321d6a6724cc82336289d17814173f2.diff
Patch: https://github.com/kamailio/kamailio/commit/644b87109321d6a6724cc82336289d17814173f2.patch
---
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);
More information about the sr-dev
mailing list