New submission from Erlend E. Aasland <erlend.aasl...@innova.no>:

Currently, we call _pysqlite_seterror() if sqlite3_open_v2() returns != 
SQLITE_OK. However, if a memory failure occurs during sqlite3_open_v2(), the 
database handle is explicitly set to NULL. This _may_ cause 
_pysqlite_seterror() to segfault, since we pass it a NULL db pointer, because 
behaviour is undefined if we pass sqlite3_errmsg() a NULL pointer.


See also:
- https://sqlite.org/c3ref/open.html

----------
assignee: erlendaasland
components: Extension Modules
messages: 404818
nosy: erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45581>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to