mavlink:Use CONFIG_BOARD_ROOT_PATH instead of string constant

This commit is contained in:
David Sidrane
2024-07-24 11:39:44 -04:00
committed by Daniel Agar
parent ea92c7ffcc
commit 54b20f1ff3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1160,7 +1160,7 @@ bool MavlinkFTP::_validatePathIsWritable(const char *path)
// Don't allow writes to system paths as they are in RAM
// Ideally we'd canonicalize the path (with 'realpath'), but it might not exist, so realpath() would fail.
// The next simpler thing is to check there's no reference to a parent dir.
if (strncmp(path, "/fs/microsd/", 12) != 0 || strstr(path, "/../") != nullptr) {
if (strncmp(path, CONFIG_BOARD_ROOT_PATH "/", 12) != 0 || strstr(path, "/../") != nullptr) {
PX4_ERR("Disallowing write to %s", path);
return false;
}