[patch] Fix for returning NULL values in SQL dict lookups

Timo Sirainen
Wed, 29 Jun 2016 16:24:54 -0000

On 11 May 2016, at 23:49, NederHost/Sebastiaan Hoogeveen <s.hoogeveen at
nederhost.nl> wrote:
>
> Hi,
>
> I noticed a bug doing dict lookups on an SQLite database which had NULL
values in its columns; a segmentation fault occurred, probably due to a null
pointer dereference in str_tabescape. The problem is that sqlite3_column_text
returns a null pointer for column values which are (SQL) NULL. It seems the
other database drivers do something similar. The following patch makes the dict
server check for null pointers and return a 'not found' reply in those
cases (I changed the order around in the decision tree to avoid having to repeat