mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00: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:
|
public:
|
||||||
|
|
||||||
class Path_too_long { };
|
class Path_too_long { };
|
||||||
|
class Path_invalid { };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -196,6 +197,9 @@ class Genode::Path_base
|
|||||||
|
|
||||||
void import(char const *path, char const *pwd = 0)
|
void import(char const *path, char const *pwd = 0)
|
||||||
{
|
{
|
||||||
|
if (!path)
|
||||||
|
throw Path_invalid();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate 'pwd' argument, if not supplied, enforce invariant
|
* Validate 'pwd' argument, if not supplied, enforce invariant
|
||||||
* that 'pwd' is an absolute path.
|
* that 'pwd' is an absolute path.
|
||||||
|
Reference in New Issue
Block a user