<div dir="ltr"><div class="gmail_default" style="color:#660000">Thanks for catching that.  I've updated my build script to set TEST_FRAMEWORK so I don't miss that in the future.  Patched in r404941, and double checked to insure tests pass.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 4, 2014 at 9:46 AM, Tzafrir Cohen <span dir="ltr"><<a href="mailto:tzafrir.cohen@xorcom.com" target="_blank">tzafrir.cohen@xorcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Jan 02, 2014 at 07:32:24PM -0000, SVN commits to the Digium repositories wrote:<br>
> Author: sgriepentrog<br>
> Date: Thu Jan  2 13:32:20 2014<br>
> New Revision: 404674<br>
><br>
> URL: <a href="http://svnview.digium.com/svn/asterisk?view=rev&rev=404674" target="_blank">http://svnview.digium.com/svn/asterisk?view=rev&rev=404674</a><br>
> Log:<br>
> func_strings: use memmove to prevent overlapping memory on strcpy<br>
><br>
> When calling REPLACE() with an empty replace-char argument, strcpy<br>
> is used to overwrite the the matching <find-char>.  However as the<br>
> src and dest arguments to strcpy must not overlap, it causes other<br>
> parts of the string to be overwritten with adjacent characters and<br>
> the result is mangled.  Patch replaces call to strcpy with memmove<br>
> and adds a test suite case for REPLACE.<br>
><br>
> (closes issue ASTERISK-22910)<br>
> Reported by: Gareth Palmer<br>
> Patches:<br>
>     func_strings.patch uploaded by Gareth Palmer (license 5169)<br>
><br>
><br>
> Modified:<br>
>     branches/1.8/funcs/func_strings.c<br>
><br>
> Modified: branches/1.8/funcs/func_strings.c<br>
> URL: <a href="http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_strings.c?view=diff&rev=404674&r1=404673&r2=404674" target="_blank">http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_strings.c?view=diff&rev=404674&r1=404673&r2=404674</a><br>

> ==============================================================================<br>
> --- branches/1.8/funcs/func_strings.c (original)<br>
> +++ branches/1.8/funcs/func_strings.c Thu Jan  2 13:32:20 2014<br>
[snip]<br>
<br>
>                * directly there */<br>
>               if (strchr(find, *strptr)) {<br>
>                       if (ast_strlen_zero(replace)) {<br>
> -                             /* Remove character */<br>
> -                             strcpy(strptr, strptr + 1); /* SAFE */<br>
> +                             memmove(strptr, strptr + 1, strlen(strptr + 1) + 1);<br>
>                               strptr--;<br>
>                       } else {<br>
>                               /* Replace character */<br>
> @@ -1619,6 +1618,76 @@<br>
>       return res;<br>
>  }<br>
><br>
> +AST_TEST_DEFINE(test_REPLACE)<br>
<br>
[snip]<br>
<br>
> +             }<br>
> +<br>
> +             AST_LIST_INSERT_HEAD(ast_channel_varshead(chan), var, entries);<br>
<br>
ast_channel_varshead does not exist in 1.8. This fails the builds.<br>
<br>
s/ast_channel_varshead(chan)/&chan->varshead/ ?<br>
<br>
<a href="http://svn.asterisk.org/svn/asterisk/trunk@357542" target="_blank">http://svn.asterisk.org/svn/asterisk/trunk@357542</a><br>
<br>
> +<br>
> +             snprintf(expression, sizeof(expression), "${REPLACE(%s,%s,%s)}", var->name, test_args[i].find_chars, test_args[i].replace_char);<br>
> +             ast_str_substitute_variables(&str, 0, chan, expression);<br>
> +<br>
> +             AST_LIST_REMOVE(ast_channel_varshead(chan), var, entries);<br>
<br>
likewise.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
               Tzafrir Cohen<br>
icq#16849755              <a href="mailto:jabber%3Atzafrir.cohen@xorcom.com">jabber:tzafrir.cohen@xorcom.com</a><br>
+972-50-7952406           mailto:<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.com</a><br>
<a href="http://www.xorcom.com" target="_blank">http://www.xorcom.com</a><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><img alt="Digium logo" src="https://my.digium.com/images/graphics/digium_RGB_signature.gif" width="288" height="50" style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">
<strong style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Scott Griepentrog</strong><br style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Digium, Inc · Software Developer</span><br style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">
<span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">445 Jan Davis Drive NW · Huntsville, AL 35806 · US</span><br style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">
<span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029</span><br style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">
<span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Check us out at: </span><a href="http://www.digium.com" style="font-family:Arial,Helvetica,sans-serif;font-size:12px" target="_blank">http://digium.com</a><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"> · </span><a href="http://www.asterisk.org" style="font-family:Arial,Helvetica,sans-serif;font-size:12px" target="_blank">http://asterisk.org</a><br>
</div>
</div>