[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: fix SIGSEGV in checks. c on Solaris (Torsten Huebler)

git at icinga.org git at icinga.org
Wed May 19 12:03:08 CEST 2010


Module: icinga-core
Branch: mfriedrich/core
Commit: 3b1ab48db98baf76c92f7fbf8c33d102931a3cf2
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=3b1ab48db98baf76c92f7fbf8c33d102931a3cf2

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed May 19 12:03:03 2010 +0200

fix SIGSEGV in checks.c on Solaris (Torsten Huebler)

fixes #345

---

 Changelog     |    1 +
 base/checks.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index eba0ed3..937bd83 100644
--- a/Changelog
+++ b/Changelog
@@ -55,6 +55,7 @@ FIXES
 * core: base/utils.c: Refactor my_fcopy() (Andreas Ericsson)
 * core: xdata/xpddefault.c: Close perfdata files if fd's are >= 0 (Andreas Ericsson)
 * core: fix xpddefault_{host,service}_perfdata_file_pipe not set properly on configuration re-read
+* core: fix SIGSEGV in checks.c on Solaris (Torsten Huebler)
 
 * cgi: minor cleanups to cgiutils.c (Eric Sesterhenn)
 * cgi: fix cmd.cgi incomplete output for command description
diff --git a/base/checks.c b/base/checks.c
index ac91806..746058a 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -606,7 +606,7 @@ int run_async_service_check(service *svc, int check_options, double latency, int
 				fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);
 				fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);
 				fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);
-				fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);
+				fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf); 
 
 				/* close the temp file */
 				fclose(check_result_info.output_file_fp);
@@ -747,7 +747,7 @@ int run_async_service_check(service *svc, int check_options, double latency, int
 					fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);
 					fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);
 					fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);
-					fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);
+					fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf); 
 
 					/* close the temp file */
 					fclose(check_result_info.output_file_fp);
@@ -3121,7 +3121,7 @@ int run_async_host_check_3x(host *hst, int check_options, double latency, int sc
 				fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);
 				fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);
 				fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);
-				fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);
+				fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf); 
 
 				/* close the temp file */
 				fclose(check_result_info.output_file_fp);





More information about the icinga-checkins mailing list