Skip to content

SQLite null pointer dereference occurs when exception is being thrown #2277

@jiajen

Description

@jiajen

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions