Re: [Nagios-devel] [PATCH] xodtemplate: segfault on

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

Re: [Nagios-devel] [PATCH] xodtemplate: segfault on

Post by Guest »

On 2013-05-10 17:43, Jeff wrote:
> Hi all,
>
> I discovered an issue with the latest version of Nagios from svn with my
> company's configuration. When a contactgroup definition contains both
> members and contactgroup_members, Nagios segfaults when trying to verify
> the configuration. After some debugging, I came up with a solution that
> appears to work for us.
>
> The issue is that the when Nagios is "recombobulating" the
> contactgroup_members, the call to strchr() is done with a null pointer,
> because the loop with the existing controlling expression allows for an
> extra iteration. Switching the controlling expression to use next_ptr
> allows the loop to exit when it should, because the last iteration's call
> to strchr() returns a null pointer. I'm not sure why it doesn't segfault
> when specifying either members or contactgroup_members (not both), but my
> solution appears to resolve the problem.
>
> Forgive me if there's a different way to propose a patch, as this is my
> first post to the list. The (extremely simple) patch is as follows:
>

This works well. Applied and pushed. Thanks.

--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: ae@op5.se
Locked