This project is archived and is in readonly mode.
lobject (conn) can segfault with bad parameter
Reported by Psycopg website | November 26th, 2013 @ 06:38 PM
Submitted by: Voicu Hodrea
attempting to create an lobject but giving a wrong parameter (something which is not a connection object) will segfault python
Comments and changes to this ticket
-
Daniele Varrazzo November 27th, 2013 @ 11:17 AM
- State changed from new to open
Thank you for the report. Args should be parsed using
O!
instead ofO
. Seecursor_init()
for an example. -
Voicu November 27th, 2013 @ 11:30 AM
Hmm, I tested what happens when doing psycopg2.extensions.cursor(<not a conn object>) and the result is weird - the cursor object is created and it lets you do operations but fails in unexpected ways - the query fails with the exception "cursor already closed" which is not very descriptive IMHO.
-
Daniele Varrazzo November 27th, 2013 @ 12:06 PM
Really? It doesn't seem so:
>>> cur = psycopg2.extensions.cursor([]) TypeError: argument 1 must be psycopg2._psycopg.connection, not list
-
Daniele Varrazzo November 27th, 2013 @ 12:45 PM
- State changed from open to resolved
-
Voicu November 27th, 2013 @ 01:35 PM
Hmm, I now see I'm on an earlier version actually (2.4.5)
>>> import psycopg2.extensions as ex >>> ex.cursor([]) <cursor object at 0x00000000026B9B40; closed: 0>
Thanks for the fix, I should probably update...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.