[icinga-checkins] icinga.org: icinga2/master: Fix crash in UnameHelper()

git at icinga.org git at icinga.org
Tue May 17 11:44:10 CEST 2016


Module: icinga2
Branch: master
Commit: 7f8a921f53736490a36bc1de87a6c40f29fdaf53
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=7f8a921f53736490a36bc1de87a6c40f29fdaf53

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue May 10 09:44:41 2016 +0200

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 0b09516..10491d9 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 */



More information about the icinga-checkins mailing list