Author amaury.forgeotdarc
Recipients amaury.forgeotdarc
Date 2008-08-24.21:02:57
SpamBayes Score 1.84587e-08
Marked as misclassified No
Message-id <1219611778.13.0.51285980437.issue3668@psf.upfronthosting.co.za>
In-reply-to
Content
When PyArg_ParseTuple correctly parses a s* format, but raises an
exception afterwards (for a subsequent parameter), the user code will
not call PyBuffer_Release() and memory will leak.
Seen by "regrtest -R:: test_binascii"

For example:
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42278 refs]
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42279 refs]
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42280 refs]


The same pattern was correctly handled by the "et#" type (where the user
has to call PyMem_Free) with the help of a cleanup list (see the
addcleanup() function in getargs.c). (See issue501716)
History
Date User Action Args
2008-08-24 21:02:58amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc
2008-08-24 21:02:58amaury.forgeotdarcsetmessageid: <1219611778.13.0.51285980437.issue3668@psf.upfronthosting.co.za>
2008-08-24 21:02:57amaury.forgeotdarclinkissue3668 messages
2008-08-24 21:02:57amaury.forgeotdarccreate