summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadShl.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-27 15:13:36 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-27 15:13:36 (GMT)
commit8225b1fd250bbd3d71a52ca514ae343a91dfcdc5 (patch)
treea91dde691bf66a3e79e57ac8058f0ab98348bc68 /unix/tclLoadShl.c
parentaf64c95042a9706c6d45118c8f341aafa5c26686 (diff)
parent192dc7dffdb4bd9d434e1f54830711df4fed4672 (diff)
downloadtcl-8225b1fd250bbd3d71a52ca514ae343a91dfcdc5.zip
tcl-8225b1fd250bbd3d71a52ca514ae343a91dfcdc5.tar.gz
tcl-8225b1fd250bbd3d71a52ca514ae343a91dfcdc5.tar.bz2
Rebase to 9.0. Add more filname encoding checks
Diffstat (limited to 'unix/tclLoadShl.c')
-rw-r--r--unix/tclLoadShl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c
index 0889c21..63e9328 100644
--- a/unix/tclLoadShl.c
+++ b/unix/tclLoadShl.c
@@ -31,13 +31,13 @@ static void UnloadFile(Tcl_LoadHandle handle);
* to the new code.
*
* Results:
- * A standard Tcl completion code. If an error occurs, an error message
+ * A standard Tcl completion code. If an error occurs, an error message
* is left in the interp's result.
*
* Side effects:
* New code suddenly appears in memory.
*
- *----------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
int
@@ -86,7 +86,11 @@ TclpDlopen(
Tcl_DString ds;
- 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);
handle = shl_load(native, BIND_DEFERRED|BIND_VERBOSE|DYNAMIC_PATH, 0L);
Tcl_DStringFree(&ds);
}