<font size=2 face="sans-serif">printf functions on Solaris crash with
SIGSEGV when getting a NULL pointer as an argument (happend here after
installing some check_mk checks).</font>
<br><font size=2 face="sans-serif">On Linux/glibc, the string "(null)"
is returned.</font>
<br>
<br><font size=2 face="sans-serif">This patch copies the fixed code from
line 821 to all other occurences of "fprintf( ... checkresult_dbuf.buf);".</font>
<br>
<br><font size=2 face="sans-serif">Torsten</font>
<br><font size=2 face="sans-serif">==============================</font>
<br>
<br>
<br><font size=2 face="sans-serif">diff -aur nagios-3.2.1/base/checks.c
nagios-3.2.1-thu/base/checks.c</font>
<br><font size=2 face="sans-serif">--- nagios-3.2.1/base/checks.c  2009-08-11
18:56:39.000000000 +0200</font>
<br><font size=2 face="sans-serif">+++ nagios-3.2.1-thu/base/checks.c  
   2010-03-16 10:37:16.267166958 +0100</font>
<br><font size=2 face="sans-serif">@@ -607,7 +607,7 @@</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);</font>
<br><font size=2 face="sans-serif">-          
                    fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);</font>
<br><font size=2 face="sans-serif">+          
                    fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf);</font>
<br>
<br><font size=2 face="sans-serif">           
                    /*
close the temp file */</font>
<br><font size=2 face="sans-serif">           
                    fclose(check_result_info.output_file_fp);</font>
<br><font size=2 face="sans-serif">@@ -748,7 +748,7 @@</font>
<br><font size=2 face="sans-serif">           
                     
      fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);</font>
<br><font size=2 face="sans-serif">           
                     
      fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);</font>
<br><font size=2 face="sans-serif">           
                     
      fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);</font>
<br><font size=2 face="sans-serif">-          
                     
      fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);</font>
<br><font size=2 face="sans-serif">+          
                     
      fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf);</font>
<br>
<br><font size=2 face="sans-serif">           
                     
      /* close the temp file */</font>
<br><font size=2 face="sans-serif">           
                     
      fclose(check_result_info.output_file_fp);</font>
<br><font size=2 face="sans-serif">@@ -3131,7 +3131,7 @@</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"early_timeout=%d\n",check_result_info.early_timeout);</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"exited_ok=%d\n",check_result_info.exited_ok);</font>
<br><font size=2 face="sans-serif">           
                    fprintf(check_result_info.output_file_fp,"return_code=%d\n",check_result_info.return_code);</font>
<br><font size=2 face="sans-serif">-          
                    fprintf(check_result_info.output_file_fp,"output=%s\n",checkresult_dbuf.buf);</font>
<br><font size=2 face="sans-serif">+          
                    fprintf(check_result_info.output_file_fp,"output=%s\n",(checkresult_dbuf.buf==NULL)?"(null)":checkresult_dbuf.buf);</font>
<br>
<br><font size=2 face="sans-serif">           
                    /*
close the temp file */</font>
<br><font size=2 face="sans-serif">           
                    fclose(check_result_info.output_file_fp);</font>
<br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">_________________________________________________________________</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Sachsen DV Betriebs- und Servicegesellschaft mbH</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Täubchenweg 26</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">04317 Leipzig</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Amtsgericht Leipzig, HRB 18545</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Geschäftsführer: Herbert Roller Brandão, Dr. Jean-Michael Pfitzner</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Aufsichtsratsvorsitzender: Sven Petersen</span><br>