summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2003-05-30 19:54:29 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2003-05-30 19:54:29 +0000
commitdf032258b55e060a98c02218a32a396a128cc9d3 (patch)
tree44eb4d2d27c25b4c6f3d38b70fb6470a0ed25915 /usr.sbin/bind/lib/dns
parent55074214c5f6ecefa154e180eb6d53bd5948f59b (diff)
string cleaning; ok jakob, tedu
Diffstat (limited to 'usr.sbin/bind/lib/dns')
-rw-r--r--usr.sbin/bind/lib/dns/masterdump.c2
-rw-r--r--usr.sbin/bind/lib/dns/name.c5
-rw-r--r--usr.sbin/bind/lib/dns/rdata.c2
-rw-r--r--usr.sbin/bind/lib/dns/sec/dst/dst_api.c4
4 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/bind/lib/dns/masterdump.c b/usr.sbin/bind/lib/dns/masterdump.c
index e52f5631824..1cd5bf433b8 100644
--- a/usr.sbin/bind/lib/dns/masterdump.c
+++ b/usr.sbin/bind/lib/dns/masterdump.c
@@ -397,7 +397,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
INDENT_TO(ttl_column);
length = snprintf(ttlbuf, sizeof(ttlbuf), "%u",
rdataset->ttl);
- INSIST(length <= sizeof ttlbuf);
+ INSIST(length < sizeof ttlbuf);
isc_buffer_availableregion(target, &r);
if (r.length < length)
return (ISC_R_NOSPACE);
diff --git a/usr.sbin/bind/lib/dns/name.c b/usr.sbin/bind/lib/dns/name.c
index 08c25ff2bb9..7c33c99fb3e 100644
--- a/usr.sbin/bind/lib/dns/name.c
+++ b/usr.sbin/bind/lib/dns/name.c
@@ -1785,9 +1785,8 @@ dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot,
char buf[5];
if (trem < 4)
return (ISC_R_NOSPACE);
- snprintf(buf, sizeof(buf),
+ snprintf(tdata, trem,
"\\%03u", c);
- memcpy(tdata, buf, 4);
tdata += 4;
trem -= 4;
ndata++;
@@ -1942,7 +1941,7 @@ dns_name_tofilenametext(dns_name_t *name, isc_boolean_t omit_final_dot,
} else {
if (trem < 3)
return (ISC_R_NOSPACE);
- sprintf(tdata, "%%%02X", c);
+ snprintf(tdata, trem, "%%%02X", c);
tdata += 3;
trem -= 3;
ndata++;
diff --git a/usr.sbin/bind/lib/dns/rdata.c b/usr.sbin/bind/lib/dns/rdata.c
index 0160e04e94d..cb696841f85 100644
--- a/usr.sbin/bind/lib/dns/rdata.c
+++ b/usr.sbin/bind/lib/dns/rdata.c
@@ -1369,7 +1369,7 @@ txt_totext(isc_region_t *source, isc_buffer_t *target) {
if (*sp < 0x20 || *sp >= 0x7f) {
if (tl < 4)
return (ISC_R_NOSPACE);
- snprintf(tp, 5, "\\%03u", *sp++);
+ snprintf(tp, tl, "\\%03u", *sp++);
tp += 4;
tl -= 4;
continue;
diff --git a/usr.sbin/bind/lib/dns/sec/dst/dst_api.c b/usr.sbin/bind/lib/dns/sec/dst/dst_api.c
index 260181a7582..637414c3e07 100644
--- a/usr.sbin/bind/lib/dns/sec/dst/dst_api.c
+++ b/usr.sbin/bind/lib/dns/sec/dst/dst_api.c
@@ -1000,7 +1000,9 @@ buildfilename(dns_name_t *name, dns_keytag_t id,
len = 1 + 3 + 1 + 5 + strlen(suffix) + 1;
if (isc_buffer_availablelength(out) < len)
return (ISC_R_NOSPACE);
- sprintf((char *) isc_buffer_used(out), "+%03d+%05d%s", alg, id, suffix);
+ snprintf((char *) isc_buffer_used(out),
+ isc_buffer_availablelength(out),
+ "+%03d+%05d%s", alg, id, suffix);
isc_buffer_add(out, len);
return (ISC_R_SUCCESS);
}