[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

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.

--
components: Build
files: spammodule.c
messages: 207433
nosy: larry, serhiy.storchaka
priority: release blocker
severity: normal
status: open
title: Argument Clinic: Py_buffer parameters are not initialized
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file33326/spammodule.c

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Larry Hastings

Larry Hastings added the comment:

Here's a patch, please review.  You can see how Py_buffer variables are 
initialized in zlibmodule.c in the patch.

--
Added file: 
http://bugs.python.org/file0/larry.clinic.py_buffer.initialization.patch.1.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

But is not {NULL} enough for Py_buffer initialization?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Or perhaps we should introduce macros Py_buffer_INIT.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Larry Hastings

Changes by Larry Hastings la...@hastings.org:


--
assignee:  - larry
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Roundup Robot

Roundup Robot added the comment:

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

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20142
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com