[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] shell: Pagefault bei 'cd '



! shell: Pfad auf NULL pruefen, bevor er an opendir() verfuettert wird
---
 src/modules/c/shell/commmands.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/modules/c/shell/commmands.c b/src/modules/c/shell/commmands.c
index 1ce37a6..bc41bba 100644
--- a/src/modules/c/shell/commmands.c
+++ b/src/modules/c/shell/commmands.c
@@ -213,6 +213,10 @@ int shell_command_cd(int argc, char* argv[], const char* args)
     } else {
         cd_args++;
         char* path = io_get_absolute_path(cd_args);
+        if (path == NULL) {
+            puts("Aufruf: cd <Verzeichnis>");
+            return -1;
+        }
 
         DIR* dir = opendir(path);
         if (dir == NULL) {
-- 
1.5.6.5