[issue23446] Use PyMem_New instead of PyMem_Malloc
Serhiy Storchaka added the comment: May be apply the fix to 3.3? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Benjamin Peterson added the comment: That would be nice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever versions: +Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Roundup Robot added the comment: New changeset d83884b3a427 by Serhiy Storchaka in branch '2.7': Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer https://hg.python.org/cpython/rev/d83884b3a427 New changeset 036a2aceae93 by Serhiy Storchaka in branch '3.4': Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer https://hg.python.org/cpython/rev/036a2aceae93 New changeset d12c7938c4b0 by Serhiy Storchaka in branch 'default': Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer https://hg.python.org/cpython/rev/d12c7938c4b0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Serhiy Storchaka added the comment: In _testbuffer.c: ndim = 64, so the changes aren't really necessary. Indeed, I'll remove these changes. The reason is of course that even an array with only 2 elements per dimension gets quite large with ndim=64. :) But an array can be with 1 element per dimension. In any case it is good that there is strict limitation on ndim values. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Stefan Krah added the comment: Yes, but these (degenerate) arrays tend to arise only as a result of slicing. Last time I looked NumPy had MAX_NDIM=32, so we should be fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
New submission from Serhiy Storchaka: Proposed patch replaces PyMem_Malloc with PyMem_New if the former is used in the form PyMem_Malloc(len * sizeof(type)). This can fix possible overflow errors and makes the code cleaner. -- components: Extension Modules, Interpreter Core files: pymem_new.patch keywords: patch messages: 235758 nosy: benjamin.peterson, haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use PyMem_New instead of PyMem_Malloc type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file38099/pymem_new.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Stefan Krah added the comment: In _testbuffer.c: ndim = 64, so the changes aren't really necessary. Somehow this fact needs to get widely known, since it does not make sense to check for overflow anytime ndim is used. The reason is of course that even an array with only 2 elements per dimension gets quite large with ndim=64. :) -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Benjamin Peterson added the comment: Very nice. I think you should also apply it to older versions, since (as we now) this sort of thing is very liable to cause security problems. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com