diff options
author | dougb <dougb@FreeBSD.org> | 2011-09-01 05:24:42 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2011-09-01 05:24:42 +0000 |
commit | ada65d99fb1417107a796d4d82e039f1d9a956a0 (patch) | |
tree | f929ac955ed5ffe7020bc29e63139cb1c4d71c57 /bin/dig/nslookup.c | |
parent | 25b6a0332b63209d2c179bbe5581562e79f3d168 (diff) | |
download | FreeBSD-src-ada65d99fb1417107a796d4d82e039f1d9a956a0.zip FreeBSD-src-ada65d99fb1417107a796d4d82e039f1d9a956a0.tar.gz |
Vendor import of BIND 9.8.1
Diffstat (limited to 'bin/dig/nslookup.c')
-rw-r--r-- | bin/dig/nslookup.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 0d368b1..e327c0f 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nslookup.c,v 1.127 2010-11-17 23:47:08 tbox Exp $ */ +/* $Id: nslookup.c,v 1.127.38.2 2011-02-28 01:19:58 tbox Exp $ */ #include <config.h> @@ -536,12 +536,6 @@ testclass(char *typetext) { } static void -safecpy(char *dest, char *src, int size) { - strncpy(dest, src, size); - dest[size-1] = 0; -} - -static void set_port(const char *value) { isc_uint32_t n; isc_result_t result = parse_uint(&n, value, 65535, "port"); @@ -571,34 +565,34 @@ setoption(char *opt) { show_settings(ISC_TRUE, ISC_FALSE); } else if (strncasecmp(opt, "class=", 6) == 0) { if (testclass(&opt[6])) - safecpy(defclass, &opt[6], sizeof(defclass)); + strlcpy(defclass, &opt[6], sizeof(defclass)); } else if (strncasecmp(opt, "cl=", 3) == 0) { if (testclass(&opt[3])) - safecpy(defclass, &opt[3], sizeof(defclass)); + strlcpy(defclass, &opt[3], sizeof(defclass)); } else if (strncasecmp(opt, "type=", 5) == 0) { if (testtype(&opt[5])) - safecpy(deftype, &opt[5], sizeof(deftype)); + strlcpy(deftype, &opt[5], sizeof(deftype)); } else if (strncasecmp(opt, "ty=", 3) == 0) { if (testtype(&opt[3])) - safecpy(deftype, &opt[3], sizeof(deftype)); + strlcpy(deftype, &opt[3], sizeof(deftype)); } else if (strncasecmp(opt, "querytype=", 10) == 0) { if (testtype(&opt[10])) - safecpy(deftype, &opt[10], sizeof(deftype)); + strlcpy(deftype, &opt[10], sizeof(deftype)); } else if (strncasecmp(opt, "query=", 6) == 0) { if (testtype(&opt[6])) - safecpy(deftype, &opt[6], sizeof(deftype)); + strlcpy(deftype, &opt[6], sizeof(deftype)); } else if (strncasecmp(opt, "qu=", 3) == 0) { if (testtype(&opt[3])) - safecpy(deftype, &opt[3], sizeof(deftype)); + strlcpy(deftype, &opt[3], sizeof(deftype)); } else if (strncasecmp(opt, "q=", 2) == 0) { if (testtype(&opt[2])) - safecpy(deftype, &opt[2], sizeof(deftype)); + strlcpy(deftype, &opt[2], sizeof(deftype)); } else if (strncasecmp(opt, "domain=", 7) == 0) { - safecpy(domainopt, &opt[7], sizeof(domainopt)); + strlcpy(domainopt, &opt[7], sizeof(domainopt)); set_search_domain(domainopt); usesearch = ISC_TRUE; } else if (strncasecmp(opt, "do=", 3) == 0) { - safecpy(domainopt, &opt[3], sizeof(domainopt)); + strlcpy(domainopt, &opt[3], sizeof(domainopt)); set_search_domain(domainopt); usesearch = ISC_TRUE; } else if (strncasecmp(opt, "port=", 5) == 0) { @@ -677,11 +671,11 @@ addlookup(char *opt) { lookup = make_empty_lookup(); if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE) == ISC_R_SUCCESS) { - safecpy(lookup->textname, store, sizeof(lookup->textname)); + strlcpy(lookup->textname, store, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ptr; lookup->rdtypeset = ISC_TRUE; } else { - safecpy(lookup->textname, opt, sizeof(lookup->textname)); + strlcpy(lookup->textname, opt, sizeof(lookup->textname)); lookup->rdtype = rdtype; lookup->rdtypeset = ISC_TRUE; } |