[Nagiosplug-checkins] CVS: nagiosplug/plugins check_dns.c,1.8.2.2,1.8.2.3
Karl DeBisschop
kdebisschop at users.sourceforge.net
Sat May 31 07:40:05 CEST 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv8555/plugins
Modified Files:
Tag: r1_3_0
check_dns.c
Log Message:
first revised patch failed to trap the
"break" in while()
Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.8.2.2
retrieving revision 1.8.2.3
diff -C2 -r1.8.2.2 -r1.8.2.3
*** check_dns.c 31 May 2003 14:22:06 -0000 1.8.2.2
--- check_dns.c 31 May 2003 14:39:33 -0000 1.8.2.3
***************
*** 140,144 ****
strip (address);
if (address==NULL || strlen(address)==0)
! terminate (STATE_CRITICAL, "DNS CRITICAL - '%s' returned empty host name string", NSLOOKUP_COMMAND);
result = STATE_OK;
}
--- 140,146 ----
strip (address);
if (address==NULL || strlen(address)==0)
! terminate (STATE_CRITICAL,
! "DNS CRITICAL - '%s' returned empty host name string\n",
! NSLOOKUP_COMMAND);
result = STATE_OK;
}
***************
*** 176,179 ****
--- 178,188 ----
output = strscpy (output, "nslookup returned error status");
}
+
+ /* If we got here, we should have an address string,
+ and we can segfault if we do not */
+ if (address==NULL || strlen(address)==0)
+ terminate (STATE_CRITICAL,
+ "DNS CRITICAL - '%s' output parsing exited with no address\n",
+ NSLOOKUP_COMMAND);
/* compare to expected address */
More information about the Commits
mailing list