If `avp_db_query` is used in the script but `db_url` was not set as a modparam 
for avpops then OpenSIPS will segfault on startup.

```
* thread #1: tid = 0x0000, 0x0000000104325a8f avpops.so`avpops_db_bind + 159 at 
avpops_db.c:157, stop reason = signal SIGSTOP
  * frame #0: 0x0000000104325a8f avpops.so`avpops_db_bind + 159 at 
avpops_db.c:157
    frame #1: 0x0000000104320a54 avpops.so`avpops_init + 292 at avpops.c:240
    frame #2: 0x0000000103851240 opensips`init_mod(m=0x0000000103a1ddd0, 
skip_others=<unavailable>) + 320 at sr_module.c:632
    frame #3: 0x00000001038510e4 opensips`init_modules + 20 at sr_module.c:676
    frame #4: 0x00000001037ffdf6 opensips`main(argc=<unavailable>, 
argv=<unavailable>) + 9334 at main.c:1205
    frame #5: 0x00007fff8370c5c9 libdyld.dylib`start + 1
```

Looks to be a result of `get_default_db_url` returning NULL and then 
`avops_db_bind` trying to use `default_db_url` without checking for the 
possibility of it being NULL.

Seems like another check in `avops_db_bind` for `default_db_url` being NULL in 
the case that a DB function is used would solve the problem.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/644
_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to