[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Is something missing here?

No; all good. Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is something missing here?

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f62763d26755260c31c717fb396550e00eb6b2a0 by Erlend Egeberg 
Aasland in branch 'main':
bpo-43398: Add test for defect connection factories (GH-27966)
https://github.com/python/cpython/commit/f62763d26755260c31c717fb396550e00eb6b2a0


--
nosy: +pablogsal
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +26413
status: pending -> open
pull_request: https://github.com/python/cpython/pull/27966

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

This issue has been fixed by recent sqlite3 improvements. Suggesting to still 
expand the test suite with tests for defect connection factories.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-03-04 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

If the connection factory __init__ method fails, we hit a seg. fault when 
pysqlite_do_all_statements() is called to clean up the defect connection: 
PyList_Size received a NULL pointer.

Suggested fix:
Split pysqlite_do_all_statements() in two: one function for resetting cursors, 
and one for resetting/finalising statements. In each function, check if the 
respective lists are NULL pointers before iterating. See attached proposed 
patch.

Test:
def test_invalid_connection_factory(self):
class DefectFactory(sqlite.Connection):
def __init__(self, *args, **kwargs):
return None
self.con = sqlite.connect(":memory:", factory=DefectFactory)

--
components: Library (Lib)
files: patch.diff
keywords: patch
messages: 388082
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] sqlite3.connect() segfaults if given a faulty Connection 
factory
type: crash
versions: Python 3.10
Added file: https://bugs.python.org/file49850/patch.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com