mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Backport:
SF Bug #1350188, "setdlopenflags" leads to crash upon "import" It was possible dlerror() returns a NULL pointer, use a default error message in this case.
This commit is contained in:
@@ -130,7 +130,10 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
||||
handle = dlopen(pathname, dlopenflags);
|
||||
|
||||
if (handle == NULL) {
|
||||
PyErr_SetString(PyExc_ImportError, dlerror());
|
||||
char *error = dlerror();
|
||||
if (error == NULL)
|
||||
error = "unknown dlopen() error";
|
||||
PyErr_SetString(PyExc_ImportError, error);
|
||||
return NULL;
|
||||
}
|
||||
if (fp != NULL && nhandles < 128)
|
||||
|
||||
Reference in New Issue
Block a user