diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-07 13:14:27 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-07 13:14:27 (GMT) |
commit | 81cbdd313896511542f19465bf012631591474db (patch) | |
tree | c49dc1fe97fe4e01700df537d02c148d31f918f3 /generic/tclLoadNone.c | |
parent | 236c0f4ffd3ac7f1cef522c0c0e00b9e72cf995f (diff) | |
download | tcl-81cbdd313896511542f19465bf012631591474db.zip tcl-81cbdd313896511542f19465bf012631591474db.tar.gz tcl-81cbdd313896511542f19465bf012631591474db.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.c | 14 |
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; } |