diff --git a/system/irtest/cmd.cxx b/system/irtest/cmd.cxx index 8dde00437..c8673c9b1 100644 --- a/system/irtest/cmd.cxx +++ b/system/irtest/cmd.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "enum.hpp" @@ -246,6 +247,17 @@ CMD1(write_data, size_t, index) data[size] = tmp; } + /* Avoid silently truncating long write_data commands. */ + + if (size == CONFIG_SYSTEM_IRTEST_MAX_SIRDATA) + { + tmp = get_next_arg < uint32_t > (); + if (tmp != 0) + { + return -E2BIG; + } + } + /* lirc require the odd length */ if (size % 2 == 0)