File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -1357,13 +1357,20 @@ void MyMesh::checkCLIRescueCmd() {
13571357
13581358 // get path from command e.g: "rm /adv_blobs"
13591359 const char *path = &cli_command[4 ];
1360-
1361- // remove file
1362- bool removed = _store->removeFile (path);
1363- if (removed){
1364- Serial.println (" File removed" );
1360+
1361+ // ensure path is not empty, or root dir
1362+ if (!path || strlen (path) == 0 || strcmp (path, " /" ) == 0 ){
1363+ Serial.println (" Invalid path provided" );
13651364 } else {
1366- Serial.println (" Failed to remove file" );
1365+
1366+ // remove file
1367+ bool removed = _store->removeFile (path);
1368+ if (removed){
1369+ Serial.println (" File removed" );
1370+ } else {
1371+ Serial.println (" Failed to remove file" );
1372+ }
1373+
13671374 }
13681375
13691376 } else if (strcmp (cli_command, " reboot" ) == 0 ) {
You can’t perform that action at this time.
0 commit comments