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.
Created on 2014年01月06日 14:05 by serhiy.storchaka, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| spammodule.c | serhiy.storchaka, 2014年01月06日 14:05 | An example | ||
| larry.clinic.py_buffer.initialization.patch.1.txt | larry, 2014年01月06日 17:12 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg207433 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年01月06日 14:05 | |
Argument Clinic doesn't initialize Py_buffer parameters. It generates cleanup code: /* Cleanup for data */ if (data.buf) PyBuffer_Release(&data); And if PyArg_ParseTuple() is failed, the buf attribute can contains arbitrary (non-NULL) data. This causes crash in PyBuffer_Release(). See issue20133 for working example. |
|||
| msg207456 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2014年01月06日 17:12 | |
Here's a patch, please review. You can see how Py_buffer variables are initialized in zlibmodule.c in the patch. |
|||
| msg207460 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年01月06日 18:18 | |
LGTM.
But is not {NULL} enough for Py_buffer initialization?
|
|||
| msg207461 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年01月06日 18:20 | |
Or perhaps we should introduce macros Py_buffer_INIT. |
|||
| msg207466 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年01月06日 18:34 | |
New changeset 16ff19d1d367 by Larry Hastings in branch 'default': Issue #20142: Py_buffer variables generated by Argument Clinic are now http://hg.python.org/cpython/rev/16ff19d1d367 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:56 | admin | set | github: 64341 |
| 2014年01月06日 18:35:06 | larry | set | status: open -> closed assignee: larry resolution: fixed stage: resolved |
| 2014年01月06日 18:34:33 | python-dev | set | nosy:
+ python-dev messages: + msg207466 |
| 2014年01月06日 18:20:48 | serhiy.storchaka | set | messages: + msg207461 |
| 2014年01月06日 18:18:55 | serhiy.storchaka | set | messages: + msg207460 |
| 2014年01月06日 17:12:59 | larry | set | files:
+ larry.clinic.py_buffer.initialization.patch.1.txt messages: + msg207456 |
| 2014年01月06日 17:07:58 | serhiy.storchaka | link | issue20133 dependencies |
| 2014年01月06日 14:05:53 | serhiy.storchaka | create | |