From ddf6a0c276122ffdf753d73bd89532b9e55b1034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Fri, 23 Apr 2021 17:35:44 +0200 Subject: [PATCH] os: add invalid path exception to Path_base In case the path is invalid during import raise the 'Path_invalid' exception. Issue #4088 --- repos/os/include/os/path.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repos/os/include/os/path.h b/repos/os/include/os/path.h index f89b715f29..cfdc744a2f 100644 --- a/repos/os/include/os/path.h +++ b/repos/os/include/os/path.h @@ -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.