Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #345] SIGSEGV in checks.c on Solaris #150

Closed
icinga-migration opened this issue Mar 16, 2010 · 2 comments
Closed

[dev.icinga.com #345] SIGSEGV in checks.c on Solaris #150

icinga-migration opened this issue Mar 16, 2010 · 2 comments
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/345

Created by mfriedrich on 2010-03-16 11:31:09 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2010-05-19 11:45:14 +00:00)
Target Version: 1.0.2
Last Update: 2010-05-19 11:45:14 +00:00 (in Redmine)


-------- Original Message --------
Subject:    [Nagios-devel] [PATCH] SIGSEGV in checks.c on Solaris
Date:   Tue, 16 Mar 2010 11:54:06 +0100
From:   thuebler@sachsendv.de
Reply-To:   Nagios Developers List 
To:     nagios-devel@lists.sourceforge.net



printf functions on Solaris crash with SIGSEGV when getting a NULL 
pointer as an argument (happend here after installing some check_mk 
checks).
On Linux/glibc, the string "(null)" is returned.

This patch copies the fixed code from line 821 to all other occurences 
of "fprintf( ... checkresult_dbuf.buf);".

Torsten
==============================


diff -aur nagios-3.2.1/base/checks.c nagios-3.2.1-thu/base/checks.c
--- nagios-3.2.1/base/checks.c  2009-08-11 18:56:39.000000000 +0200
+++ nagios-3.2.1-thu/base/checks.c      2010-03-16 10:37:16.267166958 +0100
@@ -607,7 +607,7 @@

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);
@@ -748,7 +748,7 @@

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);
@@ -3131,7 +3131,7 @@

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);

Changesets

2010-05-19 10:03:03 +00:00 by mfriedrich 3b1ab48

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

fixes #345
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2010-05-19 10:03:17 +00:00

  • Assigned to set to mfriedrich
  • Target Version set to 1.0.2

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2010-05-19 11:45:14 +00:00

  • Status changed from New to Resolved
  • Done % changed from 0 to 100

Applied in changeset commit:"3b1ab48db98baf76c92f7fbf8c33d102931a3cf2".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant