Commit cd9d825a authored by Mark Andrews's avatar Mark Andrews
Browse files

remove accidental commit

parent 33453d86
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.333 2010/11/16 00:45:34 marka Exp $ */
/* $Id: dighost.c,v 1.334 2010/11/16 05:38:30 marka Exp $ */
/*! \file
* \note
......@@ -566,8 +566,10 @@ make_server(const char *servname, const char *userarg) {
if (srv == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
strlcpy(srv->servername, servname, MXNAME);
strlcpy(srv->userarg, userarg, MXNAME);
strncpy(srv->servername, servname, MXNAME);
strncpy(srv->userarg, userarg, MXNAME);
srv->servername[MXNAME-1] = 0;
srv->userarg[MXNAME-1] = 0;
ISC_LINK_INIT(srv, link);
return (srv);
}
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.123 2010/11/16 00:46:00 marka Exp $ */
/* $Id: host.c,v 1.124 2010/11/16 05:38:30 marka Exp $ */
/*! \file */
......@@ -824,8 +824,8 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (isc_commandline_index >= argc)
show_usage();
strlcpy(hostname, argv[isc_commandline_index], sizeof(hostname));
strncpy(hostname, argv[isc_commandline_index], sizeof(hostname));
hostname[sizeof(hostname)-1]=0;
if (argc > isc_commandline_index + 1) {
set_nameserver(argv[isc_commandline_index+1]);
debug("server is %s", argv[isc_commandline_index+1]);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.125 2010/11/16 00:46:39 marka Exp $ */
/* $Id: nslookup.c,v 1.126 2010/11/16 05:38:31 marka Exp $ */
#include <config.h>
......@@ -535,6 +535,12 @@ 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;
......@@ -565,34 +571,34 @@ setoption(char *opt) {
show_settings(ISC_TRUE, ISC_FALSE);
} else if (strncasecmp(opt, "class=", 6) == 0) {
if (testclass(&opt[6]))
strlcpy(defclass, &opt[6], sizeof(defclass));
safecpy(defclass, &opt[6], sizeof(defclass));
} else if (strncasecmp(opt, "cl=", 3) == 0) {
if (testclass(&opt[3]))
strlcpy(defclass, &opt[3], sizeof(defclass));
safecpy(defclass, &opt[3], sizeof(defclass));
} else if (strncasecmp(opt, "type=", 5) == 0) {
if (testtype(&opt[5]))
strlcpy(deftype, &opt[5], sizeof(deftype));
safecpy(deftype, &opt[5], sizeof(deftype));
} else if (strncasecmp(opt, "ty=", 3) == 0) {
if (testtype(&opt[3]))
strlcpy(deftype, &opt[3], sizeof(deftype));
safecpy(deftype, &opt[3], sizeof(deftype));
} else if (strncasecmp(opt, "querytype=", 10) == 0) {
if (testtype(&opt[10]))
strlcpy(deftype, &opt[10], sizeof(deftype));
safecpy(deftype, &opt[10], sizeof(deftype));
} else if (strncasecmp(opt, "query=", 6) == 0) {
if (testtype(&opt[6]))
strlcpy(deftype, &opt[6], sizeof(deftype));
safecpy(deftype, &opt[6], sizeof(deftype));
} else if (strncasecmp(opt, "qu=", 3) == 0) {
if (testtype(&opt[3]))
strlcpy(deftype, &opt[3], sizeof(deftype));
safecpy(deftype, &opt[3], sizeof(deftype));
} else if (strncasecmp(opt, "q=", 2) == 0) {
if (testtype(&opt[2]))
strlcpy(deftype, &opt[2], sizeof(deftype));
safecpy(deftype, &opt[2], sizeof(deftype));
} else if (strncasecmp(opt, "domain=", 7) == 0) {
strlcpy(domainopt, &opt[7], sizeof(domainopt));
safecpy(domainopt, &opt[7], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "do=", 3) == 0) {
strlcpy(domainopt, &opt[3], sizeof(domainopt));
safecpy(domainopt, &opt[3], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "port=", 5) == 0) {
......@@ -671,11 +677,11 @@ addlookup(char *opt) {
lookup = make_empty_lookup();
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE)
== ISC_R_SUCCESS) {
strlcpy(lookup->textname, store, sizeof(lookup->textname));
safecpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = ISC_TRUE;
} else {
strlcpy(lookup->textname, opt, sizeof(lookup->textname));
safecpy(lookup->textname, opt, sizeof(lookup->textname));
lookup->rdtype = rdtype;
lookup->rdtypeset = ISC_TRUE;
}
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.102 2010/11/16 00:47:48 marka Exp $ */
/* $Id: os.c,v 1.103 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -950,7 +950,7 @@ ns_os_shutdownmsg(char *command, isc_buffer_t *text) {
isc_buffer_availablelength(text),
"pid: %ld", (long)pid);
/* Only send a message if it is complete. */
if (n > 0 && n < isc_buffer_availablelength(text))
if (n < isc_buffer_availablelength(text))
isc_buffer_add(text, n);
}
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.c,v 1.250 2010/11/16 00:49:18 marka Exp $ */
/* $Id: adb.c,v 1.251 2010/11/16 05:38:31 marka Exp $ */
/*! \file
*
......@@ -2350,7 +2350,6 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
*/
bucket = DNS_ADB_INVALIDBUCKET;
adbname = find_name_and_lock(adb, name, find->options, &bucket);
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
if (adb->name_sd[bucket]) {
DP(DEF_LEVEL,
"dns_adb_createfind: returning ISC_R_SHUTTINGDOWN");
......@@ -3473,7 +3472,6 @@ dns_adb_findaddrinfo(dns_adb_t *adb, isc_sockaddr_t *sa,
result = ISC_R_SUCCESS;
bucket = DNS_ADB_INVALIDBUCKET;
entry = find_entry_and_lock(adb, sa, &bucket, now);
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
if (adb->entry_sd[bucket]) {
result = ISC_R_SHUTTINGDOWN;
goto unlock;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rcode.c,v 1.13 2010/11/16 00:53:36 marka Exp $ */
/* $Id: rcode.c,v 1.14 2010/11/16 05:38:31 marka Exp $ */
#include <config.h>
#include <ctype.h>
......@@ -493,9 +493,6 @@ dns_rdataclass_format(dns_rdataclass_t rdclass,
isc_result_t result;
isc_buffer_t buf;
if (size == 0U)
return;
isc_buffer_init(&buf, array, size);
result = dns_rdataclass_totext(rdclass, &buf);
/*
......@@ -507,6 +504,8 @@ dns_rdataclass_format(dns_rdataclass_t rdclass,
else
result = ISC_R_NOSPACE;
}
if (result != ISC_R_SUCCESS)
strlcpy(array, "<unknown>", size);
if (result != ISC_R_SUCCESS) {
snprintf(array, size, "<unknown>");
array[size - 1] = '\0';
}
}
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.c,v 1.205 2010/11/16 00:53:36 marka Exp $ */
/* $Id: rdata.c,v 1.206 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -963,9 +963,6 @@ dns_rdatatype_format(dns_rdatatype_t rdtype,
isc_result_t result;
isc_buffer_t buf;
if (size == 0U)
return;
isc_buffer_init(&buf, array, size);
result = dns_rdatatype_totext(rdtype, &buf);
/*
......@@ -977,8 +974,10 @@ dns_rdatatype_format(dns_rdatatype_t rdtype,
else
result = ISC_R_NOSPACE;
}
if (result != ISC_R_SUCCESS)
strlcpy(array, "<unknown>", size);
if (result != ISC_R_SUCCESS) {
snprintf(array, size, "<unknown>");
array[size - 1] = '\0';
}
}
/*
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdatalist.c,v 1.39 2010/11/16 00:50:28 marka Exp $ */
/* $Id: rdatalist.c,v 1.40 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -54,8 +54,6 @@ static dns_rdatasetmethods_t methods = {
void
dns_rdatalist_init(dns_rdatalist_t *rdatalist) {
REQUIRE(rdatalist != NULL);
/*
* Initialize rdatalist.
*/
......@@ -127,8 +125,6 @@ isc_result_t
isc__rdatalist_next(dns_rdataset_t *rdataset) {
dns_rdata_t *rdata;
REQUIRE(rdataset != NULL);
rdata = rdataset->private2;
if (rdata == NULL)
return (ISC_R_NOMORE);
......@@ -145,8 +141,6 @@ void
isc__rdatalist_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) {
dns_rdata_t *list_rdata;
REQUIRE(rdataset != NULL);
list_rdata = rdataset->private2;
INSIST(list_rdata != NULL);
......@@ -155,10 +149,6 @@ isc__rdatalist_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) {
void
isc__rdatalist_clone(dns_rdataset_t *source, dns_rdataset_t *target) {
REQUIRE(source != NULL);
REQUIRE(target != NULL);
*target = *source;
/*
......@@ -173,8 +163,6 @@ isc__rdatalist_count(dns_rdataset_t *rdataset) {
dns_rdata_t *rdata;
unsigned int count;
REQUIRE(rdataset != NULL);
rdatalist = rdataset->private1;
count = 0;
......@@ -193,8 +181,6 @@ isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name) {
dns_rdataset_t *rdset;
dns_ttl_t ttl;
REQUIRE(rdataset != NULL);
for (rdset = ISC_LIST_HEAD(name->list);
rdset != NULL;
rdset = ISC_LIST_NEXT(rdset, link))
......@@ -242,9 +228,7 @@ isc__rdatalist_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
dns_rdataset_t *tnegsig = NULL;
dns_name_t *noqname = rdataset->private6;
REQUIRE(rdataset != NULL);
REQUIRE((rdataset->attributes & DNS_RDATASETATTR_NOQNAME) != 0);
(void)dns_name_dynamic(noqname); /* Sanity Check. */
for (rdataset = ISC_LIST_HEAD(noqname->list);
......@@ -284,8 +268,6 @@ isc__rdatalist_addclosest(dns_rdataset_t *rdataset, dns_name_t *name) {
dns_rdataset_t *rdset;
dns_ttl_t ttl;
REQUIRE(rdataset != NULL);
for (rdset = ISC_LIST_HEAD(name->list);
rdset != NULL;
rdset = ISC_LIST_NEXT(rdset, link))
......@@ -333,9 +315,7 @@ isc__rdatalist_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
dns_rdataset_t *tnegsig = NULL;
dns_name_t *closest = rdataset->private7;
REQUIRE(rdataset != NULL);
REQUIRE((rdataset->attributes & DNS_RDATASETATTR_CLOSEST) != 0);
(void)dns_name_dynamic(closest); /* Sanity Check. */
for (rdataset = ISC_LIST_HEAD(closest->list);
......
......@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: httpd.c,v 1.19 2010/11/16 00:51:41 marka Exp $ */
/* $Id: httpd.c,v 1.20 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -821,7 +821,7 @@ isc_httpd_response(isc_httpd_t *httpd)
needlen += 3 + 1; /* room for response code, always 3 bytes */
needlen += strlen(httpd->retmsg) + 2; /* return msg + CRLF */
while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS)
return (result);
......@@ -846,7 +846,7 @@ isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
needlen += 2 + strlen(val); /* :<space> and val */
needlen += 2; /* CRLF */
while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS)
return (result);
......@@ -869,7 +869,7 @@ isc_httpd_endheaders(isc_httpd_t *httpd)
{
isc_result_t result;
while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
if (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS)
return (result);
......@@ -893,7 +893,7 @@ isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
needlen += 2 + strlen(buf); /* :<space> and val */
needlen += 2; /* CRLF */
while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS)
return (result);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.c,v 1.39 2010/11/16 00:43:02 marka Exp $ */
/* $Id: netaddr.c,v 1.40 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -188,9 +188,6 @@ isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size) {
isc_buffer_init(&buf, array, size);
result = isc_netaddr_totext(na, &buf);
if (size == 0)
return;
/*
* Null terminate.
*/
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.71 2010/11/16 00:42:35 marka Exp $ */
/* $Id: sockaddr.c,v 1.72 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -182,9 +182,6 @@ isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size) {
isc_result_t result;
isc_buffer_t buf;
if (size == 0U)
return;
isc_buffer_init(&buf, array, size);
result = isc_sockaddr_totext(sa, &buf);
if (result != ISC_R_SUCCESS) {
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.136 2010/11/16 00:41:32 marka Exp $ */
/* $Id: parser.c,v 1.137 2010/11/16 05:38:31 marka Exp $ */
/*! \file */
......@@ -2006,12 +2006,8 @@ cfg_obj_isnetprefix(const cfg_obj_t *obj) {
void
cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
unsigned int *prefixlen)
{
unsigned int *prefixlen) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix);
REQUIRE(netaddr != NULL);
REQUIRE(prefixlen != NULL);
*netaddr = obj->value.netprefix.address;
*prefixlen = obj->value.netprefix.prefixlen;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment