Re: [SR-Users] [PATCH] pv: make set_var_value handle overlapping memory

2013-06-11 Thread Martin Mikkelsen
38d9e9e762e commit backported to 3.4 and it works fine. Thank you. -- Martin Mikkelsen (mam...@mamikk.no) http://www.mamikk.no/ ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.

[SR-Users] [PATCH] pv: make set_var_value handle overlapping memory

2013-05-02 Thread Martin Mikkelsen
set_var_value() may do memory corruption when a variable is set to the substring of the same variable, this is atleast the case with the s.substr, s.select, s.strip and s.striptail transformation functions which just updates the pointer to its input buffer. As an example, this would trigger a warn

Re: [SR-Users] [PATCH] Memory corruption using s.substr transformation

2013-05-02 Thread Martin Mikkelsen
On Wed, May 01, 2013 at 11:04:28AM +0200, Alex Hermann wrote: > strncpy() must be replaced with memmove() when src and dst (may) overlap. You are right, it is probably better to do the copying with memove(), then we dont have to fixup all the transformation functions. -- Martin Mikkelsen (

Re: [SR-Users] [PATCH] Memory corruption using s.substr transformation

2013-04-30 Thread Martin Mikkelsen
of the rvalue if it overlaps the lvalue before the assignment, maybe someone who is more knowledgable with the kamailio source code can take a look at this. -- Martin Mikkelsen, Zisson AS ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr

Re: [SR-Users] [PATCH] Memory corruption using s.substr transformation

2013-04-30 Thread Martin Mikkelsen
On Tue, Apr 30, 2013 at 01:29:21PM +0200, Martin Mikkelsen wrote: > I am not sure what the best fix would be for that, but I have attached a > patch which copies the string in the TR_S_SUBST code to _tr_buffer and > returns that buffer instead like a lot of the other transformations

[SR-Users] [PATCH] Memory corruption using s.substr transformation

2013-04-30 Thread Martin Mikkelsen
functions probably needs to be corrected as well. -- Martin Mikkelsen, Zisson AS ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users