<p>A quick solution for <a href="https://github.com/OpenSIPS/opensips/issues/529" class="issue-link" title="Crash with poorly given var">#529</a> to verify the function being called is populated so it doesn't segfault.</p>

<h3>gdb output &amp;&amp; bracktrace</h3>

<pre><code>Breakpoint 1, pv_parse_spec (in=in@entry=0x882e50 &lt;tstr&gt;, e=0x7ffff7425be0)
    at pvar.c:3720
3720            s.len = p - s.s;
(gdb) print pte
$5 = (pv_export_t *) 0x7ffff7420710
(gdb) print *pte
$6 = {name = {s = 0x7ffff6deed9d "T_fr_timeout", len = 12}, type = 1003, 
  getf = 0x7ffff6dbef92 &lt;pv_get_tm_fr_timeout&gt;, 
  setf = 0x7ffff6dbfc62 &lt;pv_set_tm_fr_timeout&gt;, parse_name = 0x0, 
  parse_index = 0x0, init_param = 0x0, iparam = 0}
(gdb) n
3721            if(pte-&gt;parse_name(e, &amp;s)!=0)
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
</code></pre>

<pre><code>(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000500ab9 in pv_parse_spec (in=in@entry=0x882e50 &lt;tstr&gt;, 
    e=0x7ffff7425be0) at pvar.c:3721
#2  0x00000000005b7b31 in yyparse () at cfg.y:1352
#3  0x00000000004193f1 in main (argc=&lt;optimized out&gt;, argv=0x7fffffffe6f8)
    at main.c:1022
</code></pre>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/OpenSIPS/opensips/pull/533'>https://github.com/OpenSIPS/opensips/pull/533</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>verify pv_export_t parse_name function is set before calling</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/533/files#diff-0">pvar.c</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/533.patch'>https://github.com/OpenSIPS/opensips/pull/533.patch</a></li>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/533.diff'>https://github.com/OpenSIPS/opensips/pull/533.diff</a></li>
</ul>

<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/533">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcicpcNdfb8ROvNGhyslCytDTxYUK5ks5oOUD8gaJpZM4EwLj2.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/533"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>