see if latest trunk fixes it.<br><br><br><div class="gmail_quote">On Wed, Jun 25, 2008 at 1:16 PM, Simon Perreault &lt;<a href="mailto:simon.perreault@viagenie.ca">simon.perreault@viagenie.ca</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
My dial plan contains something like the following:<br>
<br>
&lt;action application=&quot;bridge&quot; data=&quot;sofia/profile1/$1,sofia/profile2/$1&quot;/&gt;<br>
<br>
This causes a problem in mod_dialplan_xml.c, near line 150:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;len = (uint32_t) (strlen(data) + strlen(field_data) + 10);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!(substituted = malloc(len))) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;switch_log_printf(SWITCH_CHANNEL_LOG,<br>
SWITCH_LOG_CRIT, &quot;memory error!\n&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proceed = 0;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto done;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memset(substituted, 0, len);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;switch_perform_substitution(re, proceed, data, field_data,<br>
substituted, len, ovector);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;app_data = substituted;<br>
<br>
The problem is simple: len is too small because the $1 pattern appears twice.<br>
Therefore adding strlen(field_data) once is not enough. It should be<br>
multiplied by the number of times the pattern appears in the string.<br>
<br>
It seems like someone experienced the same problem before: that would explain<br>
the &quot;+ 10&quot; magic number which I am very tempted to just increase to 100. ;-)<br>
<br>
Is this really a bug or is it my imagination? If it is a bug, how should we go<br>
about fixing it?<br>
<br>
Thanks,<br>
Simon<br>
<br>
--<br>
Please try Numb, a STUN/TURN server implementation.<br>
Free access at <a href="http://numb.viagenie.ca/" target="_blank">http://numb.viagenie.ca/</a>.<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400