[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-03-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: That would be nice. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be apply the fix to 3.3? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-28 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever versions: +Python 2.7, Python 3.4 ___ Python tracker ___ ___ Pytho

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-16 Thread Roundup Robot
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 #234

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-12 Thread Stefan Krah
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 ___

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-12 Thread Serhiy Storchaka
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 p

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-11 Thread Benjamin Peterson
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 ___

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-11 Thread Stefan Krah
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 dimensio

[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-02-11 Thread Serhiy Storchaka
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: pyme