[Nagios-devel] Bugfix in reset_variables (base/utils.c)

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] Bugfix in reset_variables (base/utils.c)

Post by Guest »

This is a multi-part message in MIME format.

------_=_NextPart_001_01C50718.8AE6589D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

While trying to get nagios 2.0 (CVS current) working on =
Solaris-sparc-2.8, I noticed that the children which are forked to do =
the actual checks die in putenv() called by set_macro_environment_var. =
This error results from an incorrect array initialization in =
reset_variables which happens much earlier. Classical C array loop index =
bug.
Enclosed the fix:

*** base/utils.c Sun Jan 30 22:40:05 2005
--- base/utils.c.orig Sun Jan 30 22:37:53 2005
***************
*** 5245,5251 ****

date_format=3DDATE_FORMAT_US;

! for(x=3D0;x<MACRO_X_COUNT;x++)
macro_x[x]=3DNULL;

for(x=3D0;x<MAX_COMMAND_ARGUMENTS;x++)
--- 5245,5251 ----

date_format=3DDATE_FORMAT_US;

! for(x=3D0;x<=3DMACRO_X_COUNT;x++)
macro_x[x]=3DNULL;

for(x=3D0;x<MAX_COMMAND_ARGUMENTS;x++)=20


Hope this helps,
Dirk

Mit freundlichen Gr=FC=DFen - Kind regards=20
=20
-------------------------------------------------------------------=20
matrix technology AG=20
Dr. Dirk Porezag=20
Senior Consultant - Manager Shared Service Center=20
Landsberger Str. 400-402, D-81241 M=FCnchen=20
Tel: +49 - (0)89 - 589395-0=20
Fax: +49 - (0)89 - 589395-11=20
Web: www.matrix.ag=20
E-mail: [email protected]=20
-------------------------------------------------------------------=20
E-Mail Disclaimer=20
Der Inhalt dieser E-Mail ist ausschlie=DFlich f=FCr den bezeichneten=20
Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat=20
dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie=20
bitte, dass jede Form der Kenntnisnahme, Ver=F6ffentlichung,=20
Vervielf=E4ltigung oder Weitergabe des Inhalts dieser E-Mail=20
unzul=E4ssig ist. Wir bitten Sie, sich in diesem Fall mit dem=20
Absender der E-Mail in Verbindung zu setzen.=20
The information contained in this email is intended solely=20
for the addressee. Access to this email by anyone else is=20
unauthorized. If you are not the intended recipient, any form=20
of disclosure, reproduction, distribution or any action taken=20
or refrained from in reliance on it, is prohibited and may be=20
unlawful. Please notify the sender immediately.=20

------_=_NextPart_001_01C50718.8AE6589D
Content-Type: application/octet-stream;
name="nagios-fix.diff"
Content-Transfer-Encoding: base64
Content-Description: nagios-fix.diff
Content-Disposition: attachment;
filename="nagios-fix.diff"

KioqIGJhc2UvdXRpbHMuYwlTdW4gSmFuIDMwIDIyOjQwOjA1IDIwMDUKLS0tIGJhc2UvdXRpbHMu
Yy5vcmlnCVN1biBKYW4gMzAgMjI6Mzc6NTMgMjAwNQoqKioqKioqKioqKioqKioKKioqIDUyNDUs
NTI1MSAqKioqCiAgCiAgCWRhdGVfZm9ybWF0PURBVEVfRk9STUFUX1VTOwogIAohIAlmb3IoeD0w
O3g8TUFDUk9fWF9DT1VOVDt4KyspCiAgCQltYWNyb194W3hdPU5VTEw7CiAgCiAgCWZvcih4PTA7
eDxNQVhfQ09NTUFORF9BUkdVTUVOVFM7eCsrKQotLS0gNTI0NSw1MjUxIC0tLS0KICAKICAJZGF0
ZV9mb3JtYXQ9REFURV9GT1JNQVRfVVM7CiAgCiEgCWZvcih4PTA7eDw9TUFDUk9fWF9DT1VOVDt4
KyspCiAgCQltYWNyb194W3hdPU5VTEw7CiAgCiAgCWZvcih4PTA7eDxNQVhfQ09NTUFORF9BUkdV
TUVOVFM7eCsrKQo=

------_=_NextPart_001_01C50718.8AE6589D--





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