| From: | Federico Di Gregorio <federico(dot)digregorio(at)dndg(dot)it> |
|---|---|
| To: | psycopg(at)postgresql(dot)org |
| Subject: | Re: NULL dereference when memory is tight |
| Date: | 2011-02-24 10:39:31 |
| Message-ID: | 4D663563.8020807@dndg.it |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | psycopg |
On 24/02/11 11:32, Daniele Varrazzo wrote:
> On Thu, Feb 24, 2011 at 9:52 AM, Federico Di Gregorio
> <federico(dot)digregorio(at)dndg(dot)it> wrote:
>> On 24/02/11 10:39, Brian Sutherland wrote:
>>> Attached is a patch for another issue, though I'm not sure if calling
>>> PyErr_NoMemory within libpq is sane.
>>
>> I won't call any Py* function without holding the GIL. That's why
>> conn_notice_callback() uses its own data structure instead of a simple
>> Python list.
>
> I've fixed the potential access to uninitialized memory by simply
> discarding the notice in case allocation fails. We could additionally
> print the notice on stderr but I think the process is doomed anyway if
> it just failed to allocate a struct of two pointers.
>
> Brian, if you want to keep on playing with INFER, you should probably
> pull the outstanding patches from my devel branch
> <https://github.com/dvarrazzo/psycopg/> as in the last days I've
> cleaned up several allocation glitches throughout all the library.
All reviewd, merged and pushed.
federico
--
Federico Di Gregorio federico(dot)digregorio(at)dndg(dot)it
Studio Associato Di Nunzio e Di Gregorio http://dndg.it
Se sai che hai un ***** di file così, lo manovri subito. -- vodka
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniele Varrazzo | 2011-02-24 11:00:42 | Re: NULL dereference when memory is tight |
| Previous Message | Daniele Varrazzo | 2011-02-24 10:32:23 | Re: NULL dereference when memory is tight |