Fossil SCM
Protect against Tcl commands with no objProc.
Commit
8f6a03f7d18783a83192fb4e7f5c217b58ed5655
Parent
10f13bc5abbc23d…
1 file changed
+6
+6
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -184,10 +184,16 @@ | ||
| 184 | 184 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 185 | 185 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| 186 | 186 | Tcl_DecrRefCount(objPtr); |
| 187 | 187 | Tcl_Release((ClientData)tclInterp); |
| 188 | 188 | return TH_ERROR; |
| 189 | + } | |
| 190 | + if( !cmdInfo.objProc ){ | |
| 191 | + Th_ErrorMessage(interp, "Cannot invoke Tcl command:", argv[1], argl[1]); | |
| 192 | + Tcl_DecrRefCount(objPtr); | |
| 193 | + Tcl_Release((ClientData)tclInterp); | |
| 194 | + return TH_ERROR; | |
| 189 | 195 | } |
| 190 | 196 | Tcl_DecrRefCount(objPtr); |
| 191 | 197 | COPY_ARGV_TO_OBJV(); |
| 192 | 198 | Tcl_ResetResult(tclInterp); |
| 193 | 199 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 194 | 200 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -184,10 +184,16 @@ | |
| 184 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 185 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| 186 | Tcl_DecrRefCount(objPtr); |
| 187 | Tcl_Release((ClientData)tclInterp); |
| 188 | return TH_ERROR; |
| 189 | } |
| 190 | Tcl_DecrRefCount(objPtr); |
| 191 | COPY_ARGV_TO_OBJV(); |
| 192 | Tcl_ResetResult(tclInterp); |
| 193 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 194 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -184,10 +184,16 @@ | |
| 184 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 185 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| 186 | Tcl_DecrRefCount(objPtr); |
| 187 | Tcl_Release((ClientData)tclInterp); |
| 188 | return TH_ERROR; |
| 189 | } |
| 190 | if( !cmdInfo.objProc ){ |
| 191 | Th_ErrorMessage(interp, "Cannot invoke Tcl command:", argv[1], argl[1]); |
| 192 | Tcl_DecrRefCount(objPtr); |
| 193 | Tcl_Release((ClientData)tclInterp); |
| 194 | return TH_ERROR; |
| 195 | } |
| 196 | Tcl_DecrRefCount(objPtr); |
| 197 | COPY_ARGV_TO_OBJV(); |
| 198 | Tcl_ResetResult(tclInterp); |
| 199 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 200 |