summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 3462701a..c0ea2982 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -352,22 +352,22 @@ process_arguments (int argc, char **argv)
352 } 352 }
353 353
354 c = optind; 354 c = optind;
355 if (query_address[0] == 0) { 355 if (strlen(query_address)==0 && c<argc) {
356 if (is_host (argv[c]) == FALSE) { 356 if (is_host(argv[c])==FALSE) {
357 printf ("Invalid name/address: %s\n\n", argv[c]); 357 printf ("Invalid name/address: %s\n\n", argv[c]);
358 return ERROR; 358 return ERROR;
359 } 359 }
360 if (strlen (argv[c]) >= ADDRESS_LENGTH) 360 if (strlen(argv[c])>=ADDRESS_LENGTH)
361 terminate (STATE_UNKNOWN, "Input buffer overflow\n"); 361 terminate (STATE_UNKNOWN, "Input buffer overflow\n");
362 strcpy (query_address, argv[c++]); 362 strcpy (query_address, argv[c++]);
363 } 363 }
364 364
365 if (dns_server[0] == 0) { 365 if (strlen(dns_server)==0 && c<argc) {
366 if (is_host (argv[c]) == FALSE) { 366 if (is_host(argv[c]) == FALSE) {
367 printf ("Invalid name/address: %s\n\n", argv[c]); 367 printf ("Invalid name/address: %s\n\n", argv[c]);
368 return ERROR; 368 return ERROR;
369 } 369 }
370 if (strlen (argv[c]) >= ADDRESS_LENGTH) 370 if (strlen(argv[c]) >= ADDRESS_LENGTH)
371 terminate (STATE_UNKNOWN, "Input buffer overflow\n"); 371 terminate (STATE_UNKNOWN, "Input buffer overflow\n");
372 strcpy (dns_server, argv[c++]); 372 strcpy (dns_server, argv[c++]);
373 } 373 }