From b0bbf1e013f7df0d1f94fb9340ca34f2c99b7888 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 27 Jan 2016 21:24:20 +0100 Subject: [PATCH] Fix fsm_mountat(2) error handling. --- kernel/io.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/io.cpp b/kernel/io.cpp index 47a548f5..68bf809b 100644 --- a/kernel/io.cpp +++ b/kernel/io.cpp @@ -1138,6 +1138,8 @@ int sys_fsm_mountat(int dirfd, const char* path, const struct stat* rootst, int return delete[] pathcopy, -1; Ref desc = from->fsm_mount(&ctx, pathcopy, rootst, flags); delete[] pathcopy; + if ( !desc ) + return -1; Ref dtable = CurrentProcess()->GetDTable(); int ret = dtable->Allocate(desc, fdflags); if ( ret < 0 )