From c1849ed7d8a0b68e2773bd6dcfab86c806a44d6f Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 20 Nov 2011 22:47:39 +0100 Subject: [PATCH] / is no longer a valid filename in ramfs. --- sortix/fs/ramfs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sortix/fs/ramfs.cpp b/sortix/fs/ramfs.cpp index c7a262d0..2df9c1ab 100644 --- a/sortix/fs/ramfs.cpp +++ b/sortix/fs/ramfs.cpp @@ -183,7 +183,10 @@ namespace Sortix DevBuffer* DevRAMFS::OpenFile(const char* path, int flags, mode_t mode) { - if ( *path++ != '/' ) { return NULL; } + if ( *path++ != '/' ) { Error::Set(Error::ENOENT); return NULL; } + + // Hack to prevent / from being a filename. + if ( path++ == 0 ) { Error::Set(Error::ENOENT); return NULL; } if ( files ) {