New submission from Euler Taveira de Oliveira <eu...@timbira.com>: 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.
I don't know what is the best fix but we have two possibilities: (i) check the second argument in PyDict_SetItemString() before calling PyString_FromString() and returns null if that argument is null; (ii) replace the assert() in PyString_FromString() to 'if (str == NULL) return NULL;'. This bug was reported as a PostgreSQL bug at [1]. [1] http://archives.postgresql.org/pgsql-hackers/2009-03/msg01344.php ---------- components: Interpreter Core messages: 84833 nosy: eulerto severity: normal status: open title: PyDict_SetItemString() fails when the second argument is null type: crash _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5627> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com