summaryrefslogtreecommitdiff
path: root/rtemstoolkit
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-05-08 15:09:45 +1000
committerChris Johns <chrisj@rtems.org>2018-06-18 12:26:05 +1000
commitf7d303f104626e512bfe84ba0695b309dd542d19 (patch)
treeebe0addcc6c1ce3fbe42e2fc967207d1c7ff70ae /rtemstoolkit
parent8dd3803af1618bcc2734f488988b9106e47024fb (diff)
rtemstoolkit/path: Fix crash when going above the root directory.
Diffstat (limited to 'rtemstoolkit')
-rw-r--r--rtemstoolkit/rld-path.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/rtemstoolkit/rld-path.cpp b/rtemstoolkit/rld-path.cpp
index c848676..35af055 100644
--- a/rtemstoolkit/rld-path.cpp
+++ b/rtemstoolkit/rld-path.cpp
@@ -145,7 +145,13 @@ namespace rld
}
else if (dir == "..")
{
+ /*
+ * If the path goes above the root of where we are there is nothing
+ * that can be done so return the path passed in.
+ */
aps.pop_back ();
+ if (aps.empty ())
+ return path;
}
else
{