<p>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.</p>

<p>I looked at a gdb backtrace, but not investigated it any further.</p>

<p>Program terminated with signal 11, Segmentation fault.<br>
#0  dbt_get_refs (_dtp=0x7f45d03655d8, _k=0x7fffbaf8f870, _n=6) at dbt_res.c:169<br>
169                             if(_k[i]-&gt;len==_dtp-&gt;colv[j]-&gt;name.len<br>
(gdb) bt<br>
#0  dbt_get_refs (_dtp=0x7f45d03655d8, _k=0x7fffbaf8f870, _n=6) at dbt_res.c:169<br>
<a href="https://github.com/OpenSIPS/opensips/issues/1" class="issue-link" title="Dummy ticket">#1</a>  0x00007f45d39cd7a8 in dbt_query (_h=0x7f45d3fef940, _k=, _op=0x0, _v=0x0, _c=0x7fffbaf8f870, _n=0, _nc=6, _o=0x0,<br>
    _r=0x7fffbaf8f8e0) at dbt_base.c:208<br>
<a href="https://github.com/OpenSIPS/opensips/issues/2" class="issue-link" title="Dummy issue">#2</a>  0x00007f45d26dd418 in ds_reload_db () from /usr/lib/opensips/modules/dispatcher.so<br>
<a href="https://github.com/OpenSIPS/opensips/pull/3" class="issue-link" title="Compilation problem under CentOS 6">#3</a>  0x00007f45d26df341 in ?? () from /usr/lib/opensips/modules/dispatcher.so<br>
<a href="https://github.com/OpenSIPS/opensips/pull/4" class="issue-link" title="Compilation problem under CentOS 6">#4</a>  0x000000000046e411 in ?? ()<br>
<a href="https://github.com/OpenSIPS/opensips/pull/5" class="issue-link" title="spec file update to CentOS 6">#5</a>  0x000000000046e3a9 in ?? ()<br>
<a href="https://github.com/OpenSIPS/opensips/issues/6" class="issue-link" title="Wrong password column used for authentication">#6</a>  0x000000000042e702 in main ()</p>

<p>Using version 1.11.</p>

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

<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/issues/308">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNDA4MTEzOCwiZGF0YSI6eyJpZCI6NDAwNjM1ODJ9fQ==--e44fa8878ff912f0b84a8565570222e5d6a95313.gif" width="1" /></p>