Hi,<br><br>There appears to be a minor bug in t_msgbuilder.c in HEAD. The build_local() function is off-by-one when computing the length of the message it is going to build. End result is that locally generated messages (CANCEL and some ACKs) have an extra garbage byte at end of message. The garbage byte happens to be a null. Other SIP stacks complain about this extra byte.<br>

<br>The problem is this:<br>           (Trans-&gt;extra_hdrs.s?Trans-&gt;extra_hdrs.len:1)<br>The &quot;1&quot; should be a &quot;0&quot; to be consistent with the later code.<br><br>I&#39;ve included patch that fixed this and changes the length computation to match the order in which the message it built. It also breaks up the length computation into groups. Goal is to make it easier to find future length computation errors -- took 4 hours to find this relatively simple error. I also added a final assert -- not sure what the opensips policy is on asserts.<br>

<br>Thanks,<br>Kennard<br><br><br><br>