Module: kamailio
Branch: master
Commit: 93932a4ff18760d8fc8c59bd08984fd00cfd7759
URL: 
https://github.com/kamailio/kamailio/commit/93932a4ff18760d8fc8c59bd08984fd00cfd7759

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2018-05-27T10:56:00+02:00

rls: allocate size for normalized uri for cloning buffer

- it can be longer than pres uri, when proto prefix needs to be added

---

Modified: src/modules/rls/subscribe.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/93932a4ff18760d8fc8c59bd08984fd00cfd7759.diff
Patch: 
https://github.com/kamailio/kamailio/commit/93932a4ff18760d8fc8c59bd08984fd00cfd7759.patch

---

diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c
index a96d1674f7..3d71e7e3f3 100644
--- a/src/modules/rls/subscribe.c
+++ b/src/modules/rls/subscribe.c
@@ -978,6 +978,8 @@ int send_resource_subs(char* uri, void* param)
                                pres_uri.len, pres_uri.s);
                return -1;
        }
+       LM_DBG("pres uri [%.*s] - normalized uri [%.*s]\n",
+                       pres_uri.len, pres_uri.s, normalized_uri->len, 
normalized_uri->s);
 
        if (parse_uri(normalized_uri->s, normalized_uri->len, &parsed_pres_uri)
                        < 0) {
@@ -1009,7 +1011,8 @@ int send_resource_subs(char* uri, void* param)
                LM_ERR("out of private memory\n");
                return -1;
        }
-       if ((tmp_str->s = (char *)pkg_malloc(sizeof(char) * pres_uri.len)) == 
NULL)
+       if ((tmp_str->s = (char *)pkg_malloc(sizeof(char)
+                                                       * normalized_uri->len)) 
== NULL)
        {
                pkg_free(tmp_str);
                LM_ERR("out of private memory\n");


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to