<p>In <a href="https://github.com/OpenSIPS/opensips/pull/623#discussion_r38191595">modules/dialog/dlg_db_handler.c</a>:</p>
<pre style='color:#555'>&gt; +                j++;
&gt; +        }
&gt; +        *at = 0;
&gt; +        sout-&gt;len = at - sout-&gt;s;
&gt; +
&gt; +        return 0;
&gt; +}
&gt; +
&gt; +static int encode_string(str *dst, str *src)
&gt; +{
&gt; +        unsigned char x;
&gt; +        int j = 0;
&gt; +        char *at = dst-&gt;s;
&gt; +        char *p = src-&gt;s;
&gt; +        while (j &lt;= src-&gt;len) {
&gt; +                if (*p &lt; 32 || *p &gt; 127 || *p == &#39;#&#39; || *p == &#39;|&#39; || *p == &#39;\\&#39;) {
</pre>
<p>127 is not printable, so it should be caught by this branch. You could test <em>p against 127, (</em>p == 127), since *p can never be greater than 127 (max char).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/623/files#r38191595">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciVbJQRqIs2jnoFVmIJ2nrzyVdATGks5osD_RgaJpZM4Fz92d.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/pull/623/files#r38191595"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>