[patch] Add check for NULL for event_list_high

Mathieu Gagné mgagne at iweb.com
Wed Oct 21 03:54:00 CEST 2009


I was playing with the source for my own pleasure and discovered what 
could be a bug.

"event_list_high" is a chained list for high priority events.

When Nagios
- Pops the next event to be executed from the list,
- Sets the new head of the list to the next event using the "next" 
pointer of the current event and
- Assigns NULL to the "prev" pointer of the new event at the head

it does not verify if this new head isn't NULL (being therefore at the 
end of the chained list) before trying to update the "prev" pointer.

Nagios does check for NULL when dealing with the list "event_list_low" 
but not with "event_list_high".

Attached is a patch fixing this potential bug.

--
Mathieu
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios-null-event_list_high.patch
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20091020/2e925e30/attachment.ksh>
-------------- next part --------------
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list