[PATCH] xodtemplate: segfault on contactgroup_members
Andreas Ericsson
ae at op5.se
Sun May 12 11:22:44 CEST 2013
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 at 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.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
More information about the Developers
mailing list