<pre><code>(gdb) up
#1 0x000000000043e344 in build_req_buf_from_sip_req (
msg=msg@entry=0x7f6107e03660,
returned_len=returned_len@entry=0x7fff7e5ac434,
send_sock=send_sock@entry=0x7f6107dec340, proto=<optimized out>,
flags=flags@entry=1) at msg_translator.c:1539
1539 in msg_translator.c
(gdb) print len
$36 = 617
(gdb) print s_offset
$37 = 662
(gdb) print offset
$38 = 582
</code></pre>
<p>So <code>s_offset</code> is 45 bytes past <code>len</code>. I checked and <code>len</code> properly points to the last char (<code>\0</code>) in <code>msg->buf</code>.</p>
<p>Looking right before line 1539:</p>
<pre><code>(gdb) print msg->first_line.u.request.uri.s-buf
$7 = 4
</code></pre>
<p>OK, that's a BYE, so 4.</p>
<pre><code>(gdb) print msg->first_line.u.request.uri.len
$14 = 46
</code></pre>
<p>At that point <code>s_offset</code> should be 50, correct?</p>
<pre><code>(gdb) print buf+50
$18 = 0x78e4b2 <buf.7798+50> " SIP/2.0\r\nFrom: <sip:(removed)
</code></pre>
<p>Hmmm, not sure if that's what's expected.</p>
<p>Now, looking into <code>process_lumps</code>:</p>
<pre><code>(gdb) print msg->body_lumps
$1 = (struct lump *) 0x0
</code></pre>
<p>OK, can skip that one I assume? For <code>add_rm</code>:</p>
<pre><code>(gdb) print *(msg->add_rm)
$2 = {type = HDR_VIA_T, op = LUMP_NOP, u = {offset = 286, subst = 286,
cond = 286, value = 0x11e <Address 0x11e out of bounds>}, len = 0,
before = 0x7f6107e04a30, after = 0x0, next = 0x7f6107e04530,
flags = LUMPFLAG_BRANCH}
(gdb) print *(msg->add_rm->before)
$3 = {type = HDR_VIA_T, op = LUMP_ADD, u = {offset = 132139392,
subst = 132139392, cond = 132139392,
value = 0x7f6107e04980 "Via: SIP/2.0/UDP (removed):5060;branch=z9hG4bKe234.19887526.0\r\n"},
len = 66, before = 0x0, after = 0x0,
next = 0x0, flags = LUMPFLAG_BRANCH}
(gdb) print *(msg->add_rm->next)
$30 = {type = HDR_OTHER_T, op = LUMP_DEL, u = {offset = 530,
subst = 530, cond = 530,
value = 0x212 <Address 0x212 out of bounds>}, len = 66,
before = 0x0, after = 0x0, next = 0x7f6107e04700,
flags = LUMPFLAG_NONE}
(gdb) print *(msg->add_rm->next->next)
$31 = {type = HDR_ROUTE_T, op = LUMP_DEL, u = {offset = 530,
subst = 530, cond = 530,
value = 0x212 <Address 0x212 out of bounds>}, len = 66,
before = 0x0, after = 0x0, next = 0x0, flags = LUMPFLAG_NONE}
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/issues/155#issuecomment-31574619'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNDM1OTU1NSwiZGF0YSI6eyJpZCI6MjI5MTE1MDd9fQ==--b48d2cdf1f7019a0d4944b9a347914232299e5e7.gif' height='1' width='1'></p>