A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
control size for .ir file
Geo37d831b6b0e8
diff --git a/src/Controllers/InfraredController.cpp b/src/Controllers/InfraredController.cppindex c4a743b0..7c75012c 100644--- a/src/Controllers/InfraredController.cpp+++ b/src/Controllers/InfraredController.cpp@@ -337,6 +337,14 @@ void InfraredController::handleLoad(TerminalCommand const& command) {uint16_t idxFile = userInputManager.readValidatedChoiceIndex("File number", files, 0);const std::string& chosen = files[idxFile];+ // Check size+ int MAX_FILE_SIZE = 32 * 1024; // 32 KB+ auto fileSize = littleFsService.getFileSize("/" + chosen);+ if (fileSize == 0 || fileSize > MAX_FILE_SIZE) {+ terminalView.println("INFRARED: File size invalid (>32KB): " + chosen);+ return;+ }+// Load file contentstd::string text;if (!littleFsService.readAll("/" + chosen, text)) {