Expected behavior
A ConnectionFailedException should be thrown when the database fails to be created.
Actual behavior
A segmentation fault occurs due to a null pointer dereference occuring when the exception is being thrown.
Steps to reproduce the problem
The code below reproduces the problem:
try
{
Poco::SQL::Session tmp(Poco::SQL::SQLite::Connector::KEY, "\\/some\\/invalid\\/path\\/sqlite.db", 1);
}
catch (Poco::SQL::ConnectionFailedException&)
{
}
Other relevant information
An attempt to throw an exception is made when the database fails to be created. However since the exception invokes a mutex, sqlite3_db_mutex(pDB) causes a segmentation fault when pDB is null which can occur if the database cannot be created. Fix included in #2276.