Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15383a0

Browse files
author
Thomas Heller
committed
Merged revisions 64976-64977 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r64976 | thomas.heller | 2008-07-15 21:39:38 +0200 (Tue, 15 Jul 2008) | 3 lines Issue #3313: Contrary to the man page, a failed dlopen() call does not always set a dlerror() message. ........ r64977 | thomas.heller | 2008-07-15 21:44:25 +0200 (Tue, 15 Jul 2008) | 2 lines Add Victor Stinner, he provided the patch for issue #3313. ........
1 parent a7024e9 commit 15383a0

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,3 +771,4 @@ Uwe Zessin
771771
Amaury Forgeot d'Arc
772772
Peter �strand
773773
Tarek Ziad�
774+
Victor Stinner

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Core and Builtins
2727
Library
2828
-------
2929

30+
- Issue #3313: Fixed a crash when a failed dlopen() call does not set
31+
a valid dlerror() message.
32+
3033
- Issue #3258: Fixed a crash when a ctypes POINTER type to an
3134
incomplete structure was created.
3235

Modules/_ctypes/callproc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,8 +1383,11 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args)
13831383
mode |= RTLD_NOW;
13841384
handle = ctypes_dlopen(name, mode);
13851385
if (!handle) {
1386+
char *errmsg = ctypes_dlerror();
1387+
if (!errmsg)
1388+
errmsg = "dlopen() error";
13861389
PyErr_SetString(PyExc_OSError,
1387-
ctypes_dlerror());
1390+
errmsg);
13881391
return NULL;
13891392
}
13901393
return PyLong_FromVoidPtr(handle);

0 commit comments

Comments
 (0)