From 476fd5388da4aa6e23658460199e26e88e05dc5d Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 17:49:55 +0100 Subject: Only allow stdout and stderr for screen logging --- src/Logging.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Logging.cpp b/src/Logging.cpp index f95df0e..8290ca0 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -124,7 +124,11 @@ void CLogger::_setLevel(int id, log_level m_eLevel) void CLogger::setOutputScreen(int fd, log_level m_eLevel) { _assureIsInitialized(); - clog_set_fd(0, fd); + if(fd==1||fd==2){ + clog_set_fd(0, fd); + }else{ + error(__FILE__,__LINE__,"Invalid file descriptor"); + } _setLevel(0,m_eLevel); } -- cgit v1.2.3