Bug 728653 - Crash in mozilla::storage::Connection::stepStatement @ sqlite3_extended_result_codes. r=mak.

This commit is contained in:
Rafael Ávila de Espíndola 2012-03-01 08:13:45 -05:00
Родитель 1a7fa00b46
Коммит ff41f2f2a9
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -877,6 +877,16 @@ Connection::stepStatement(sqlite3_stmt *aStatement)
bool checkedMainThread = false;
TimeStamp startTime = TimeStamp::Now();
// mDBConn may be null if the executing statement has been created and cached
// after a call to asyncClose() but before the connection has been nullified
// by internalClose(). In such a case closing the connection fails due to
// the existence of prepared statements, but mDBConn is set to null
// regardless. This usually happens when other tasks using cached statements
// are asynchronously scheduled for execution and any of them ends up after
// asyncClose. See bug 728653 for details.
if (!mDBConn)
return SQLITE_MISUSE;
(void)::sqlite3_extended_result_codes(mDBConn, 1);
int srv;