Bugfix in reset_variables (base/utils.c)

Ethan Galstad nagios at nagios.org
Wed Feb 2 18:59:55 CET 2005


Thanks - patch will be in CVS later today.


On 30 Jan 2005 at 23:10, Dirk Porezag wrote:

> 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=DATE_FORMAT_US;
> 
> !       for(x=0;x<MACRO_X_COUNT;x++)
>                 macro_x[x]=NULL;
> 
>         for(x=0;x<MAX_COMMAND_ARGUMENTS;x++)
> --- 5245,5251 ----
> 
>         date_format=DATE_FORMAT_US;
> 
> !       for(x=0;x<=MACRO_X_COUNT;x++)
>                 macro_x[x]=NULL;
> 
>         for(x=0;x<MAX_COMMAND_ARGUMENTS;x++) 
> 
> 
> Hope this helps,
> Dirk
> 
> Mit freundlichen Grüßen - Kind regards 
> 
> -------------------------------------------------------------------
> matrix technology AG Dr. Dirk Porezag Senior Consultant - Manager
> Shared Service Center Landsberger Str. 400-402, D-81241 München Tel: 
> +49 - (0)89 - 589395-0 Fax: +49 - (0)89 - 589395-11 Web:   
> www.matrix.ag E-mail:  Dirk.Porezag at matrix.ag
> -------------------------------------------------------------------
> E-Mail Disclaimer Der Inhalt dieser E-Mail ist ausschließlich für den
> bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene
> Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten
> Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung,
> Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig
> ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail
> in Verbindung zu setzen. The information contained in this email is
> intended solely for the addressee. Access to this email by anyone else
> is unauthorized. If you are not the intended recipient, any form of
> disclosure, reproduction, distribution or any action taken or
> refrained from in reliance on it, is prohibited and may be unlawful.
> Please notify the sender immediately. 
> 



Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl




More information about the Developers mailing list