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

Timo Sirainen tss at iki.fi
Wed Jun 29 16:24:54 UTC 2016


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 return values):

Fixed a bit differently: https://github.com/dovecot/core/commit/923ed5836f90175e736846f02edfd9c2ee07dc6b




More information about the dovecot mailing list