Skip to content

Commit

Permalink
Fixed rishka_sanitize_path() usage on rishka_syscalls.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Apr 10, 2024
1 parent 357086c commit 3460174
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/rishka_syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,12 @@ long RishkaSyscall::Sys::randomImpl() {

bool RishkaSyscall::Sys::changeDir(RishkaVM* vm) {
auto dir = vm->getPointerParam<char*>(0);

dir = rishka_sanitize_path(dir);
if(dir == "~") {
vm->setWorkingDirectory(F("/"));
return true;
}

dir = rishka_sanitize_path(vm->getWorkingDirectory(), dir);
if(!SD.exists(dir))
return false;

Expand Down

0 comments on commit 3460174

Please sign in to comment.