summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadDl.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-14 11:13:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-14 11:13:30 (GMT)
commite3a6968b93006d08f0e1dd834826e5f4b37fbd1a (patch)
tree25b8638690fc9ea5964d7fbb58ea3c0632a63fe5 /unix/tclLoadDl.c
parent2d5f7e8dd76dd8207be4946a14992e3b96c8e2a2 (diff)
downloadtcl-e3a6968b93006d08f0e1dd834826e5f4b37fbd1a.zip
tcl-e3a6968b93006d08f0e1dd834826e5f4b37fbd1a.tar.gz
tcl-e3a6968b93006d08f0e1dd834826e5f4b37fbd1a.tar.bz2
Use "strict" in almost all commands. Only "glob" and environment variables are left out. (Experimental)core-tip-657-candidate
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r--unix/tclLoadDl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index 0913698..7ba580e 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -108,7 +108,11 @@ TclpDlopen(
Tcl_DString ds;
const char *fileName = TclGetString(pathPtr);
- native = Tcl_UtfToExternalDString(NULL, fileName, TCL_INDEX_NONE, &ds);
+ if (Tcl_UtfToExternalDStringEx(interp, NULL, fileName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) {
+ Tcl_DStringFree(&ds);
+ return TCL_ERROR;
+ }
+ native = Tcl_DStringValue(&ds);
/*
* Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
*/
@@ -179,7 +183,11 @@ FindSymbol(
* the underscore.
*/
- native = Tcl_UtfToExternalDString(NULL, symbol, TCL_INDEX_NONE, &ds);
+ if (Tcl_UtfToExternalDStringEx(NULL, NULL, symbol, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) {
+ Tcl_DStringFree(&ds);
+ return NULL;
+ }
+ native = Tcl_DStringValue(&ds);
proc = dlsym(handle, native); /* INTL: Native. */
if (proc == NULL) {
Tcl_DStringInit(&newName);