diff options
| author | 2022-05-22 20:46:04 -0400 | |
|---|---|---|
| committer | 2022-05-22 20:46:28 -0400 | |
| commit | 88dc7bcf92b4b1ac96c1186c3bc70fec53b207e1 (patch) | |
| tree | 39162133fa77a00916526d8c3d17dc19c98c253c /src/emu/debug/debugcmd.cpp | |
| parent | c24dc4a0e178d6975a30e4d1d69f5c559288d5f7 (diff) | |
debugger: Impose an arbitrary upper limit on the count parameter of the gni command to prevent denial of service
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
| -rw-r--r-- | src/emu/debug/debugcmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index ff29281ab64..781ce93e9a5 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -1382,12 +1382,18 @@ void debugger_commands::execute_go_branch(bool sense, const std::vector<std::str void debugger_commands::execute_go_next_instruction(const std::vector<std::string> ¶ms) { u64 count = 1; + static constexpr u64 MAX_COUNT = 512; // if we have a parameter, use it instead */ if (params.size() > 0 && !validate_number_parameter(params[0], count)) return; if (count == 0) return; + if (count > MAX_COUNT) + { + m_console.printf("Too many instructions (must be %d or fewer)\n", MAX_COUNT); + return; + } device_state_interface *stateintf; device_t *cpu = m_machine.debugger().console().get_visible_cpu(); |
