[OpenSIPS-Devel] [opensips] Loading a db_text file with one unterminated line causes crash (#308)

gergelypeli notifications at github.com
Tue Aug 19 17:25:38 CEST 2014


If a database file only contains one line with the column type definitions, it is only parsed correctly (as an empty table) if the file ends with a newline. If not, loading the file crashes opensips.

I looked at a gdb backtrace, but not investigated it any further.

Program terminated with signal 11, Segmentation fault.
#0  dbt_get_refs (_dtp=0x7f45d03655d8, _k=0x7fffbaf8f870, _n=6) at dbt_res.c:169
169                             if(_k[i]->len==_dtp->colv[j]->name.len
(gdb) bt
#0  dbt_get_refs (_dtp=0x7f45d03655d8, _k=0x7fffbaf8f870, _n=6) at dbt_res.c:169
#1  0x00007f45d39cd7a8 in dbt_query (_h=0x7f45d3fef940, _k=<optimized out>, _op=0x0, _v=0x0, _c=0x7fffbaf8f870, _n=0, _nc=6, _o=0x0,
    _r=0x7fffbaf8f8e0) at dbt_base.c:208
#2  0x00007f45d26dd418 in ds_reload_db () from /usr/lib/opensips/modules/dispatcher.so
#3  0x00007f45d26df341 in ?? () from /usr/lib/opensips/modules/dispatcher.so
#4  0x000000000046e411 in ?? ()
#5  0x000000000046e3a9 in ?? ()
#6  0x000000000042e702 in main ()

Using version 1.11.

As a related issue: if a table has records, but the last record's line is unterminated, that record is silently ignored.


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/308
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140819/36b3ef13/attachment.htm>


More information about the Devel mailing list