[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-03-31 Thread Euler Taveira de Oliveira
New submission from Euler Taveira de Oliveira : PyDict_SetItemString() fails when the second argument (key) is null pointer. It occurs because PyString_FromString(key) call doesn't check for null pointer and if we're in a disabled assert environment the assert() is not caught and strlen() fails.

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-03-31 Thread Euler Taveira de Oliveira
Euler Taveira de Oliveira added the comment: It seems PyDict_DelItemString() and PyDict_SetItem() suffer from the same disease. :( Both use assert() to detect a null pointer but fail to prevent it. As I stated in the previous comment, maybe the right fix is to replace assert() with the 'if (foo

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-03-31 Thread Georg Brandl
Georg Brandl added the comment: I am not sure why you consider this a bug. You should certainly not pass NULL pointers around where the docs do not explicitly allow this. -- nosy: +georg.brandl resolution: -> wont fix status: open -> pending ___ Pyt

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-03-31 Thread Euler Taveira de Oliveira
Euler Taveira de Oliveira added the comment: I know that it is a good programming practice checking null pointers but sometimes programmers are lazy. ;) I still think that high level functions should check for null pointers. -- ___ Python tracker <

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Georg Brandl
Georg Brandl added the comment: Raymond, do you have an opinion about this? -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ _

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Martin, do you have any insight into this? The values being seen and the fact that it occurs only in a particular build suggests that pyport.h has inconsistent definitions for Py_ssize_t, PY_SSIZE_T_MAX, and PY_SSIZE_T_MIN. The values look like signed and u

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Martin, do you have any insight into this Are you sure you commenting into the right issue? How does Py_ssize_t come into play here? -- title: PyDict_SetItemString() fails when the second argument is null -> PyDict_SetItemString() fails when the se

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend rejecting this one. The assert is sufficient for third-party modules to run their tests and detect bad calls. The code path is too critical to add another check. -- assignee: loewis -> georg.brandl _

[issue5627] PyDict_SetItemString() fails when the second argument is null

2009-04-01 Thread Georg Brandl
Georg Brandl added the comment: Closing. -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib