[Nagios-devel] [PATCH] SIGSEGV in checks.c on Solaris

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH] SIGSEGV in checks.c on Solaris

Post by Guest »

Dies ist eine mehrteilige Nachricht im MIME-Format.
--=_alternative 003BE24FC12576E8_=
Content-Type: text/plain; charset="utf-8"
content-transfer-encoding: quoted-printable

printf functions on Solaris crash with SIGSEGV when getting a NULL pointer=
=20
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=20
"fprintf( ... checkresult_dbuf.buf);".

Torsten
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D


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=20
+0100
@@ -607,7 +607,7 @@
=20
fprintf(check_result_info.output_file_fp,"early_timeout=3D%d\n",check_resul=
t_info.early_timeout);
=20
fprintf(check_result_info.output_file_fp,"exited_ok=3D%d\n",check_result_in=
fo.exited_ok);
=20
fprintf(check_result_info.output_file_fp,"return_code=3D%d\n",check_result_=
info.return_code);
-=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",checkresult_dbuf.b=
uf);
+=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",(checkresult_dbuf.=
buf=3D=3DNULL)?"(null)":checkresult_dbuf.buf);

/* close the temp file */
fclose(check_result_info.output_file_fp);
@@ -748,7 +748,7 @@
=20
fprintf(check_result_info.output_file_fp,"early_timeout=3D%d\n",check_resul=
t_info.early_timeout);
=20
fprintf(check_result_info.output_file_fp,"exited_ok=3D%d\n",check_result_in=
fo.exited_ok);
=20
fprintf(check_result_info.output_file_fp,"return_code=3D%d\n",check_result_=
info.return_code);
-=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",checkresult_dbuf.b=
uf);
+=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",(checkresult_dbuf.=
buf=3D=3DNULL)?"(null)":checkresult_dbuf.buf);

/* close the temp file */
fclose(check_result_info.output_file_fp);
@@ -3131,7 +3131,7 @@
=20
fprintf(check_result_info.output_file_fp,"early_timeout=3D%d\n",check_resul=
t_info.early_timeout);
=20
fprintf(check_result_info.output_file_fp,"exited_ok=3D%d\n",check_result_in=
fo.exited_ok);
=20
fprintf(check_result_info.output_file_fp,"return_code=3D%d\n",check_result_=
info.return_code);
-=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",checkresult_dbuf.b=
uf);
+=20
fprintf(check_result_info.output_file_fp,"output=3D%s\n",(checkresult_dbuf.=
buf=3D=3DNULL)?"(null)":checkresult_dbuf.buf);

/* close the temp file */
fclose(check_result_info.output_file_fp);


_________________________________________________________________

Sachsen DV Betriebs- und Servicegesellschaft mbH
T=C3=A4ubchenweg 26
04317 Leipzig
Amtsgericht Leipzig, HRB 18545

Gesch=C3=A4ftsf=C3=BChrer: Herbert Roller Brand=C3=A3o, Dr. Jean-Michael Pf=
itzner

Aufsichtsratsvorsitzender: Sven Petersen
--=_alternative 003BE24FC12576E8_=
Content-Type: text/html; charset="utf-8"
content-transfer-encoding: quoted-printable

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 "(nu=
ll)"
is returned.

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

Torsten
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


diff -aur nagios-3.2.1/base/checks.c
nagios-3.2.1-thu/base/checks.c
--- nagios-3.2.1/base/checks.c &nbsp=
;2009-08-11
18:56:39.000000000 +0200
+++ nagios-3.2.1-thu/base/checks.c &=
nbsp;
   2010-03-16 10:37:16.267166958 +0

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked