mirror of
https://github.com/holub/mame
synced 2025-06-05 12:26:35 +03:00
debugger: Impose an arbitrary upper limit on the count parameter of the gni command to prevent denial of service
This commit is contained in:
parent
c24dc4a0e1
commit
88dc7bcf92
@ -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();
|
||||
|
@ -978,7 +978,8 @@ const help_item f_static_help_list[] =
|
||||
"debugger until a breakpoint or watchpoint is hit, or until you manually break in using the "
|
||||
"assigned key. Before executing, the gni command sets a temporary unconditional breakpoint "
|
||||
"<count> instructions sequentially past the current one, which is automatically removed when "
|
||||
"hit. If <count> is omitted, its default value is 1."
|
||||
"hit. If <count> is omitted, its default value is 1. If <count> is specified as zero, the "
|
||||
"command does nothing. <count> is not permitted to exceed 512 decimal."
|
||||
"\n"
|
||||
"Examples:\n"
|
||||
"\n"
|
||||
|
Loading…
Reference in New Issue
Block a user