mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
os: add invalid path exception to Path_base
In case the path is invalid during import raise the 'Path_invalid' exception. Issue #4088
This commit is contained in:
committed by
Norman Feske
parent
8f30fc993d
commit
ddf6a0c276
@@ -30,6 +30,7 @@ class Genode::Path_base
|
||||
public:
|
||||
|
||||
class Path_too_long { };
|
||||
class Path_invalid { };
|
||||
|
||||
protected:
|
||||
|
||||
@@ -196,6 +197,9 @@ class Genode::Path_base
|
||||
|
||||
void import(char const *path, char const *pwd = 0)
|
||||
{
|
||||
if (!path)
|
||||
throw Path_invalid();
|
||||
|
||||
/*
|
||||
* Validate 'pwd' argument, if not supplied, enforce invariant
|
||||
* that 'pwd' is an absolute path.
|
||||
|
||||
Reference in New Issue
Block a user