This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2008-07-06.22:55:58
SpamBayes Score 4.2433207e-05
Marked as misclassified No
Message-id <1215384961.05.0.023038653338.issue3307@psf.upfronthosting.co.za>
In-reply-to
Content
newDBObject(), called by DB_construct(), doesn't check correctly the 
result of all to the external function db_create(). It checks if 
self->db is NULL, but db_create() doesn't change self->db value on 
error. So if self->db is uninitialized, the error is not catched.

Two ideas to fix the bug:
 - check "if (err)" instead of "if (self->db != NULL)"
 - set self->db=NULL before calling db_create()

I implemented the second proposition in the attached patch.

Note: The bug occurs with PYDEBUG, I don't know if PyObject_New() 
fills new allocate memory to zero (I think no, but I'm not sure).
History
Date User Action Args
2008-07-06 22:56:01vstinnersetspambayes_score: 4.24332e-05 -> 4.2433207e-05
recipients: + vstinner
2008-07-06 22:56:01vstinnersetspambayes_score: 4.24332e-05 -> 4.24332e-05
messageid: <1215384961.05.0.023038653338.issue3307@psf.upfronthosting.co.za>
2008-07-06 22:55:59vstinnerlinkissue3307 messages
2008-07-06 22:55:59vstinnercreate