<p>The following code is accepted by the cfg parser and will run:</p>

<pre><code>$xavp(test1=>stuff) = "america";   # Good
$xavp(test2->stuff) = "bahamas";  # Bad  - Hyphen instead of equals
$xavp(test3) = "cuba"; # Bad - No name given
xlog("L_WARN", "1: $xavp(test1)\n");
xlog("L_WARN", "2: $xavp(test2)\n");
xlog("L_WARN", "3: $xavp(test3)\n");
xlog("L_WARN", "4: $xavp(test1=>stuff)\n");
xlog("L_WARN", "5: $xavp(test2=>stuff)\n");
xlog("L_WARN", "6: $xavp(test3=>stuff)\n");
</code></pre>

<p>This prints:</p>

<pre><code>1: <<xavp:0x7ff16f82c898>>
2: <null>
3: cuba
4: america
5: null
<null> or general protection fault/ core was generated......
</code></pre>

<p>The crash can be fixed by checking the child node type (incoming), but could there be more validation of the (x)avp variables.<br>
I notice that $avp's can be treated as $xavps i.e. the following is accepted.<br>
<code>$avp(test4=>stuff) = "dominica";</code></p>

<p>Is the usage above intended to be acceptable?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/511">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZWsVkySTpzvG9YTtoX8fJjIoGgHOks5pk0fEgaJpZM4HbTve.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/kamailio/kamailio/issues/511"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>