From 7f8a921f53736490a36bc1de87a6c40f29fdaf53 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 10 May 2016 09:44:41 +0200 Subject: [PATCH] Fix crash in UnameHelper() fixes #11714 --- lib/base/utility.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 0b09516b759..10491d9c458 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -1435,6 +1435,9 @@ static String UnameHelper(char type) FILE *fp = popen(cmd, "r"); + if (!fp) + return "Unknown"; + char line[1024]; std::ostringstream msgbuf; @@ -1892,4 +1895,4 @@ String Utility::GetIcingaDataPath(void) return String(path) + "\\icinga2"; } -#endif /* _WIN32 */ \ No newline at end of file +#endif /* _WIN32 */