A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
limit user input to a max allowed length during prompt
Geo64da2b41d07f
diff --git a/src/Managers/UserInputManager.cpp b/src/Managers/UserInputManager.cppindex 23329d45..1663ad4f 100644--- a/src/Managers/UserInputManager.cpp+++ b/src/Managers/UserInputManager.cpp@@ -28,6 +28,10 @@ std::string UserInputManager::getLine(bool onlyNumber /* = false */) {continue;}+ if (result.size() >= MAX_ALLOWED_INPUT_LENGTH) {+ continue;+ }+// Only numberif (onlyNumber && !std::isdigit(c)) {continue;diff --git a/src/Managers/UserInputManager.h b/src/Managers/UserInputManager.hindex bf6d0e4c..d16f5295 100644--- a/src/Managers/UserInputManager.h+++ b/src/Managers/UserInputManager.h@@ -47,4 +47,6 @@ private:ITerminalView& terminalView;IInput& terminalInput;ArgTransformer& argTransformer;++ const size_t MAX_ALLOWED_INPUT_LENGTH = 256;};