Core and Builtins
-----------------
+ - Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
+ prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
+
+- Issue #18408: Fix many various bugs in code handling errors, especially
+ on memory allocation failure (MemoryError).
+
- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
+- Issue #18342: Use the repr of a module name when an import fails when using
+ ``from ... import ...``.
+
- Issue #17872: Fix a segfault in marshal.load() when input stream returns
more bytes than requested.
/* Check VPATH to see if argv0_path is in the build directory. */
vpath = _Py_char2wchar(VPATH, NULL);
if (vpath != NULL) {
- wcscpy(prefix, argv0_path);
+ wcsncpy(prefix, argv0_path, MAXPATHLEN);
+ prefix[MAXPATHLEN] = L'\0';
joinpath(prefix, vpath);
- PyMem_Free(vpath);
+ PyMem_RawFree(vpath);
joinpath(prefix, L"Lib");
joinpath(prefix, LANDMARK);
if (ismodule(prefix))