server/server: fix clang static analyzer warning
[fw/openocd] / src / server / startup.tcl
1 # Defines basic Tcl procs for OpenOCD server modules
2
3 # Handle GDB 'R' packet. Can be overridden by configuration script,
4 # but it's not something one would expect target scripts to do
5 # normally
6 proc ocd_gdb_restart {target_id} {
7         # Fix!!! we're resetting all targets here! Really we should reset only
8         # one target
9         reset halt
10 }
11
12 proc prevent_cps {} {
13         echo "Possible SECURITY ATTACK detected."
14         echo "It looks like somebody is sending POST or Host: commands to OpenOCD."
15         echo "This is likely due to an attacker attempting to use Cross Protocol Scripting"
16         echo "to compromise your OpenOCD instance. Connection aborted."
17         exit
18 }
19
20 proc POST {args} { prevent_cps }
21 proc Host: {args} { prevent_cps }