summaryrefslogtreecommitdiffstats
path: root/generic/tclLoadNone.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-07 13:14:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-07 13:14:27 (GMT)
commitaaa3242a11ed60dd8fc2b008460de84fc49d949b (patch)
treec49dc1fe97fe4e01700df537d02c148d31f918f3 /generic/tclLoadNone.c
parent6524bed322ce1bc175f6fd8df81558b8cdd17ee6 (diff)
downloadtcl-aaa3242a11ed60dd8fc2b008460de84fc49d949b.zip
tcl-aaa3242a11ed60dd8fc2b008460de84fc49d949b.tar.gz
tcl-aaa3242a11ed60dd8fc2b008460de84fc49d949b.tar.bz2
Where "interp" is only used for error-reporting, it can be allowed to be NULL. This should fix [5da26d4760]: Tcl_LoadFile() segfaults if "interp" is NULL.
Diffstat (limited to 'generic/tclLoadNone.c')
-rw-r--r--generic/tclLoadNone.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c
index 6cb4378..6af5c4f 100644
--- a/generic/tclLoadNone.c
+++ b/generic/tclLoadNone.c
@@ -45,9 +45,11 @@ TclpDlopen(
* file. */
int flags)
{
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "dynamic loading is not currently available on this system",
- -1));
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "dynamic loading is not currently available on this system",
+ -1));
+ }
return TCL_ERROR;
}
@@ -109,8 +111,10 @@ TclpLoadMemory(
int flags)
/* Dummy: unused by this implementation */
{
- Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory "
- "is not available on this system", -1));
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory "
+ "is not available on this system", -1));
+ }
return TCL_ERROR;
}