Title: sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized
Type: crash Stage: patch review
Components: Extension Modules Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Oren Milman
Priority: normal Keywords: patch

Created on 2017-10-11 19:09 by Oren Milman, last changed 2017-10-11 19:41 by Oren Milman.

Pull Requests
URL Status Linked Edit
PR 3958 open Oren Milman, 2017-10-11 19:41
Messages (1)
msg304172 - (view) Author: Oren Milman (Oren Milman) * Date: 2017-10-11 19:09
The following code causes a crash:
import sqlite3
cursor = sqlite3.Cursor.__new__(sqlite3.Cursor)

this is because pysqlite_cursor_close() (in Modules/_sqlite/cursor.c) assumes
that `self->connection` is not NULL, and passes it to pysqlite_check_thread(),
which crashes.

I would open a PR to fix this soon.
Date User Action Args
2017-10-11 19:41:54Oren Milmansetkeywords: + patch
stage: patch review
pull_requests: + pull_request3934
2017-10-11 19:09:18Oren Milmancreate