summaryrefslogtreecommitdiffstats
path: root/generic/tclZipfs.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-10 13:12:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-10 13:12:52 (GMT)
commit8dabc4aee21c8501cc1c9375dcc5029d6ce8532d (patch)
tree1d25993c02eafec155f1cc7f14aaa2e3866587a8 /generic/tclZipfs.c
parent36b64ba2fa81ebb4d546d20e50d76cbda227dc39 (diff)
parentc4b1e16389ea10988c2465db583ebe757c7d2a8d (diff)
downloadtcl-8dabc4aee21c8501cc1c9375dcc5029d6ce8532d.zip
tcl-8dabc4aee21c8501cc1c9375dcc5029d6ce8532d.tar.gz
tcl-8dabc4aee21c8501cc1c9375dcc5029d6ce8532d.tar.bz2
Rebase to latest 9.0
Diffstat (limited to 'generic/tclZipfs.c')
-rw-r--r--generic/tclZipfs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 54eb4b0..c2c0a01 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -2890,7 +2890,11 @@ ZipAddFile(
* crazy enough to embed NULs in filenames, they deserve what they get!
*/
- zpathExt = Tcl_UtfToExternalDString(tclUtf8Encoding, zpathTcl, -1, &zpathDs);
+ if (Tcl_UtfToExternalDStringEx(interp, tclUtf8Encoding, zpathTcl, TCL_INDEX_NONE, 0, &zpathDs, NULL) != TCL_OK) {
+ Tcl_DStringFree(&zpathDs);
+ return TCL_ERROR;
+ }
+ zpathExt = Tcl_DStringValue(&zpathDs);
zpathlen = strlen(zpathExt);
if (zpathlen + ZIP_CENTRAL_HEADER_LEN > bufsize) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -3559,7 +3563,11 @@ ZipFSMkZipOrImg(
}
z = (ZipEntry *) Tcl_GetHashValue(hPtr);
- name = Tcl_UtfToExternalDString(tclUtf8Encoding, z->name, TCL_INDEX_NONE, &ds);
+ if (Tcl_UtfToExternalDStringEx(interp, tclUtf8Encoding, z->name, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) {
+ ret = TCL_ERROR;
+ goto done;
+ }
+ name = Tcl_DStringValue(&ds);
len = Tcl_DStringLength(&ds);
SerializeCentralDirectoryEntry(start, end, (unsigned char *) buf,
z, len);