[issue25631] Segmentation fault with invalid Unicode command-line arguments in embedded Python

2015-11-15 Thread Itai Bar-Natan
New submission from Itai Bar-Natan: The following embedded application, which calls Py_Main with a "-W X" argument where X is not a valid Unicode string, returns a segmentation fault: ``` #include "Python.h" main() { wchar_t *invalid_str; invalid_str = mal

[issue21073] Py_ReprEnter potentially misbehaves during malformed thread states

2014-03-26 Thread Itai Bar-Natan
New submission from Itai Bar-Natan: While browsing the Python source code, I found this suspicious snippet in Py_ReprEnter: dict = PyThreadState_GetDict(); if (dict == NULL) return 0; It seems to me like the last line should be "return -1;". The way the program