<p></p>
<p>The <code>len</code> field will not include the 0, so copying such a cloned value will not be affected by ending 0. Besides the str fields that point in larger buffers (like with the sip parser fields that point inside msg->buf), most of the other str->s values are 0 terminating (e.g., most of pseudo-variables values, functions parameters evaluated by fixup_get_svalue(), ...). I am sure there are way more 0-terminated str->s fields than the non-0-terminated.</p>
<p>Again, here we discuss about cloning values, their result is not impacting anything else, they are supposed to be independent of other resources.</p>
<p>The rule is more like: do not rely on 0-terminated str->s value unless you are sure it is.</p>
<p>In this case it is made sure to be 0-terminated and used accordingly.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2512#issuecomment-712668915">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLF6YC3O3PXOFU7DITSLU7LVANCNFSM4SWDGBOQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZILTZQ43M7CIG275F3SLU7LVA5CNFSM4SWDGBO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFJ5HN4Y.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2512#issuecomment-712668915",
"url": "https://github.com/kamailio/kamailio/pull/2512#issuecomment-712668915",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>