[sr-dev] [kamailio] Invalid XAVP use causes a crash (#511)

Hugh Waite notifications at github.com
Tue Feb 16 17:37:24 CET 2016


The following code is accepted by the cfg parser and will run:
```
$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");
```
This prints:
```
1: <<xavp:0x7ff16f82c898>>
2: <null>
3: cuba
4: america
5: null
<null> or general protection fault/ core was generated......
```
The crash can be fixed by checking the child node type (incoming), but could there be more validation of the (x)avp variables.
I notice that $avp's can be treated as $xavps i.e. the following is accepted.
`$avp(test4=>stuff) = "dominica";`

Is the usage above intended to be acceptable?


---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/511
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160216/87941539/attachment.html>


More information about the sr-dev mailing list