From 644b87109321d6a6724cc82336289d17814173f2 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Mon, 7 Mar 2016 15:10:32 +0100 Subject: [PATCH] siputils: tel2sip(): fix 'off by one' when allocating memory --- modules/siputils/checks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/siputils/checks.c b/modules/siputils/checks.c index a44c06662f5..963032c9403 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);