[Nagiosplug-devel] [ nagiosplug-Bugs-741296 ] check_dns.c segfault with -a and NXDOMAIN
SourceForge.net
noreply at sourceforge.net
Wed May 21 11:29:12 CEST 2003
Bugs item #741296, was opened at 2003-05-21 13:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=741296&group_id=29880
Category: None
Group: CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: David Maynard (dpmaynard)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_dns.c segfault with -a and NXDOMAIN
Initial Comment:
check_dns.c 1.13 from CVS compiled and run under
Red Hat 7.1 and testing against bind-8.2.3+patches on
a Cobalt generates a segmentation fault if the requested
domain does not exist and the "-a" flag is specified.
The "address" variable is NULL when the code reaches
line 183 and attempts a strcmp. The null pointer to
strcmp generates a segfault.
Arguably, this is a bug in the parsing of the "address"
variable since it probably shouldn't be a NULL at this
point in the code. However, the code for "-a" is
predicated on STATE_OK, so if something earlier in the
code indicates STATE_WARNING (e.g., because it
detects a NXDOMAIN return), then the "-a" check will
not be performed and Nagios will "miss" the CRITICAL
error. (If I tell it to match an expected address, it is
critical if it doesn't exist.)
As a result, my "fix" (to achieve the results I need), was
to change the code for the "-a" test to include a check
for a null address pointer. My patch attached.
-dpm
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=741296&group_id=29880
More information about the Devel
mailing list