mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
4748. [cleanup] Sprintf to snprintf coversions. [RT #46132]
This commit is contained in:
parent
7cb14b610e
commit
a009d03a1a
2
CHANGES
2
CHANGES
@ -1,3 +1,5 @@
|
|||||||
|
4748. [cleanup] Sprintf to snprintf coversions. [RT #46132]
|
||||||
|
|
||||||
4747. [func] Synthesis of responses from DNSSEC-verified records.
|
4747. [func] Synthesis of responses from DNSSEC-verified records.
|
||||||
Stage 3 - synthesize NODATA responses. [RT #40138]
|
Stage 3 - synthesize NODATA responses. [RT #40138]
|
||||||
|
|
||||||
|
@ -2813,7 +2813,7 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
|||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
fatal("out of memory");
|
fatal("out of memory");
|
||||||
if (dsdir != NULL)
|
if (dsdir != NULL)
|
||||||
sprintf(filename, "%s/", dsdir);
|
snprintf(filename, filenamelen, "%s/", dsdir);
|
||||||
else
|
else
|
||||||
filename[0] = 0;
|
filename[0] = 0;
|
||||||
strlcat(filename, prefix, filenamelen);
|
strlcat(filename, prefix, filenamelen);
|
||||||
@ -3490,12 +3490,13 @@ main(int argc, char *argv[]) {
|
|||||||
origin = file;
|
origin = file;
|
||||||
|
|
||||||
if (output == NULL) {
|
if (output == NULL) {
|
||||||
|
size_t size;
|
||||||
free_output = ISC_TRUE;
|
free_output = ISC_TRUE;
|
||||||
output = isc_mem_allocate(mctx,
|
size = strlen(file) + strlen(".signed") + 1;
|
||||||
strlen(file) + strlen(".signed") + 1);
|
output = isc_mem_allocate(mctx, size);
|
||||||
if (output == NULL)
|
if (output == NULL)
|
||||||
fatal("out of memory");
|
fatal("out of memory");
|
||||||
sprintf(output, "%s.signed", file);
|
snprintf(output, size, "%s.signed", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputformatstr != NULL) {
|
if (inputformatstr != NULL) {
|
||||||
|
@ -1790,8 +1790,8 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
|
|||||||
unsigned int prefixlen, const char *server,
|
unsigned int prefixlen, const char *server,
|
||||||
const char *contact)
|
const char *contact)
|
||||||
{
|
{
|
||||||
char *cp;
|
char reverse[48+sizeof("ip6.arpa.")] = { 0 };
|
||||||
char reverse[48+sizeof("ip6.arpa.")];
|
char buf[sizeof("x.x.")];
|
||||||
const char *dns64_dbtype[4] = { "_dns64", "dns64", ".", "." };
|
const char *dns64_dbtype[4] = { "_dns64", "dns64", ".", "." };
|
||||||
const char *sep = ": view ";
|
const char *sep = ": view ";
|
||||||
const char *viewname = view->name;
|
const char *viewname = view->name;
|
||||||
@ -1814,15 +1814,13 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
|
|||||||
/*
|
/*
|
||||||
* Construct the reverse name of the zone.
|
* Construct the reverse name of the zone.
|
||||||
*/
|
*/
|
||||||
cp = reverse;
|
|
||||||
s6 = na->type.in6.s6_addr;
|
s6 = na->type.in6.s6_addr;
|
||||||
while (prefixlen > 0) {
|
while (prefixlen > 0) {
|
||||||
prefixlen -= 8;
|
prefixlen -= 8;
|
||||||
sprintf(cp, "%x.%x.", s6[prefixlen/8] & 0xf,
|
snprintf(buf, sizeof(buf), "%x.%x.", s6[prefixlen/8] & 0xf,
|
||||||
(s6[prefixlen/8] >> 4) & 0xf);
|
(s6[prefixlen/8] >> 4) & 0xf);
|
||||||
cp += 4;
|
strlcat(reverse, buf, sizeof(reverse));
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcat(reverse, "ip6.arpa.", sizeof(reverse));
|
strlcat(reverse, "ip6.arpa.", sizeof(reverse));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1270,8 +1270,8 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
|||||||
case isc_statsformat_json:
|
case isc_statsformat_json:
|
||||||
#ifdef HAVE_JSON
|
#ifdef HAVE_JSON
|
||||||
zoneobj = (json_object *) dumparg->arg;
|
zoneobj = (json_object *) dumparg->arg;
|
||||||
sprintf(buf, "%s%s%s", stale ? "#" : "",
|
snprintf(buf, sizeof(buf), "%s%s%s",
|
||||||
nxrrset ? "!" : "", typestr);
|
stale ? "#" : "", nxrrset ? "!" : "", typestr);
|
||||||
obj = json_object_new_int64(val);
|
obj = json_object_new_int64(val);
|
||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -179,7 +179,7 @@ nsecify(char *filename) {
|
|||||||
len = strlen(filename);
|
len = strlen(filename);
|
||||||
if (len + 4 + 1 > sizeof(newfilename))
|
if (len + 4 + 1 > sizeof(newfilename))
|
||||||
fatal("filename too long");
|
fatal("filename too long");
|
||||||
sprintf(newfilename, "%s.new", filename);
|
snprintf(newfilename, sizeof(newfilename), "%s.new", filename);
|
||||||
result = dns_db_dump(db, NULL, newfilename);
|
result = dns_db_dump(db, NULL, newfilename);
|
||||||
check_result(result, "dns_db_dump");
|
check_result(result, "dns_db_dump");
|
||||||
dns_db_detach(&db);
|
dns_db_detach(&db);
|
||||||
|
@ -109,7 +109,7 @@ main(int argc, char *argv[]) {
|
|||||||
RUNTIME_CHECK(isc_rwlock_init(&lock, 5, 10) == ISC_R_SUCCESS);
|
RUNTIME_CHECK(isc_rwlock_init(&lock, 5, 10) == ISC_R_SUCCESS);
|
||||||
|
|
||||||
for (i = 0; i < nworkers; i++) {
|
for (i = 0; i < nworkers; i++) {
|
||||||
sprintf(name, "%02u", i);
|
snprintf(name, sizeof(name), "%02u", i);
|
||||||
dupname = strdup(name);
|
dupname = strdup(name);
|
||||||
RUNTIME_CHECK(dupname != NULL);
|
RUNTIME_CHECK(dupname != NULL);
|
||||||
if (i != 0 && i % 3 == 0)
|
if (i != 0 && i % 3 == 0)
|
||||||
|
@ -102,8 +102,8 @@ my_recv(isc_task_t *task, isc_event_t *event) {
|
|||||||
*/
|
*/
|
||||||
if (strcmp(event->ev_arg, "so2") != 0) {
|
if (strcmp(event->ev_arg, "so2") != 0) {
|
||||||
region = dev->region;
|
region = dev->region;
|
||||||
sprintf(buf, "\r\nReceived: %.*s\r\n\r\n",
|
snprintf(buf, sizeof(buf), "\r\nReceived: %.*s\r\n\r\n",
|
||||||
(int)dev->n, (char *)region.base);
|
(int)dev->n, (char *)region.base);
|
||||||
region.base = isc_mem_get(mctx, strlen(buf) + 1);
|
region.base = isc_mem_get(mctx, strlen(buf) + 1);
|
||||||
if (region.base != NULL) {
|
if (region.base != NULL) {
|
||||||
region.length = strlen(buf) + 1;
|
region.length = strlen(buf) + 1;
|
||||||
|
@ -1878,8 +1878,9 @@ buildfilename(dns_name_t *name, dns_keytag_t id,
|
|||||||
len = 1 + 3 + 1 + 5 + strlen(suffix) + 1;
|
len = 1 + 3 + 1 + 5 + strlen(suffix) + 1;
|
||||||
if (isc_buffer_availablelength(out) < len)
|
if (isc_buffer_availablelength(out) < len)
|
||||||
return (ISC_R_NOSPACE);
|
return (ISC_R_NOSPACE);
|
||||||
sprintf((char *) isc_buffer_used(out), "+%03d+%05d%s", alg, id,
|
snprintf((char *) isc_buffer_used(out),
|
||||||
suffix);
|
(int)isc_buffer_availablelength(out),
|
||||||
|
"+%03d+%05d%s", alg, id, suffix);
|
||||||
isc_buffer_add(out, len);
|
isc_buffer_add(out, len);
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
@ -695,10 +695,14 @@ dst_gssapi_acceptctx(gss_cred_id_t cred,
|
|||||||
*/
|
*/
|
||||||
const char *old = getenv("KRB5_KTNAME");
|
const char *old = getenv("KRB5_KTNAME");
|
||||||
if (old == NULL || strcmp(old, gssapi_keytab) != 0) {
|
if (old == NULL || strcmp(old, gssapi_keytab) != 0) {
|
||||||
char *kt = malloc(strlen(gssapi_keytab) + 13);
|
size_t size;
|
||||||
|
char *kt;
|
||||||
|
|
||||||
|
size = strlen(gssapi_keytab) + 13;
|
||||||
|
kt = malloc(size);
|
||||||
if (kt == NULL)
|
if (kt == NULL)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
sprintf(kt, "KRB5_KTNAME=%s", gssapi_keytab);
|
snprintf(kt, size, "KRB5_KTNAME=%s", gssapi_keytab);
|
||||||
if (putenv(kt) != 0)
|
if (putenv(kt) != 0)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||||||
isc_buffer_putstr(buf, "Signing with ");
|
isc_buffer_putstr(buf, "Signing with ");
|
||||||
|
|
||||||
dns_secalg_format(alg, algbuf, sizeof(algbuf));
|
dns_secalg_format(alg, algbuf, sizeof(algbuf));
|
||||||
sprintf(keybuf, "key %d/%s", keyid, algbuf);
|
snprintf(keybuf, sizeof(keybuf), "key %d/%s", keyid, algbuf);
|
||||||
isc_buffer_putstr(buf, keybuf);
|
isc_buffer_putstr(buf, keybuf);
|
||||||
} else
|
} else
|
||||||
return (ISC_R_NOTFOUND);
|
return (ISC_R_NOTFOUND);
|
||||||
|
@ -522,7 +522,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
|
|||||||
RETERR(dns_rdatatype_totext(t, target));
|
RETERR(dns_rdatatype_totext(t, target));
|
||||||
} else {
|
} else {
|
||||||
char buf[sizeof("TYPE65535")];
|
char buf[sizeof("TYPE65535")];
|
||||||
sprintf(buf, "TYPE%u", t);
|
snprintf(buf, sizeof(buf), "TYPE%u", t);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -182,7 +182,7 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u", n);
|
snprintf(buf, sizeof(buf), "%u", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -210,7 +210,7 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -225,7 +225,7 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, " %u ", n);
|
snprintf(buf, sizeof(buf), " %u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -80,7 +80,7 @@ totext_ch_a(ARGS_TOTEXT) {
|
|||||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||||
RETERR(dns_name_totext(&prefix, sub, target));
|
RETERR(dns_name_totext(&prefix, sub, target));
|
||||||
|
|
||||||
sprintf(buf, "%o", addr); /* note octal */
|
snprintf(buf, sizeof(buf), "%o", addr); /* note octal */
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
return (str_totext(buf, target));
|
return (str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ totext_afsdb(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u ", num);
|
snprintf(buf, sizeof(buf), "%u ", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
dns_name_fromregion(&name, ®ion);
|
dns_name_fromregion(&name, ®ion);
|
||||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||||
|
@ -85,7 +85,7 @@ totext_cert(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -56,14 +56,14 @@ totext_csync(ARGS_TOTEXT) {
|
|||||||
|
|
||||||
num = uint32_fromregion(&sr);
|
num = uint32_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
sprintf(buf, "%lu", num);
|
snprintf(buf, sizeof(buf), "%lu", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
num = uint16_fromregion(&sr);
|
num = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu", num);
|
snprintf(buf, sizeof(buf), "%lu", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
return (typemap_totext(&sr, NULL, target));
|
return (typemap_totext(&sr, NULL, target));
|
||||||
|
@ -111,7 +111,7 @@ generic_totext_ds(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -119,7 +119,7 @@ generic_totext_ds(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -127,7 +127,7 @@ generic_totext_ds(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u", n);
|
snprintf(buf, sizeof(buf), "%u", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -140,7 +140,7 @@ totext_hip(ARGS_TOTEXT) {
|
|||||||
/*
|
/*
|
||||||
* Algorithm
|
* Algorithm
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%u ", algorithm);
|
snprintf(buf, sizeof(buf), "%u ", algorithm);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -134,7 +134,7 @@ totext_ipseckey(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint8_fromregion(®ion);
|
num = uint8_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 1);
|
isc_region_consume(®ion, 1);
|
||||||
sprintf(buf, "%u ", num);
|
snprintf(buf, sizeof(buf), "%u ", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -142,7 +142,7 @@ totext_ipseckey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
gateway = uint8_fromregion(®ion);
|
gateway = uint8_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 1);
|
isc_region_consume(®ion, 1);
|
||||||
sprintf(buf, "%u ", gateway);
|
snprintf(buf, sizeof(buf), "%u ", gateway);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -150,7 +150,7 @@ totext_ipseckey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
num = uint8_fromregion(®ion);
|
num = uint8_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 1);
|
isc_region_consume(®ion, 1);
|
||||||
sprintf(buf, "%u ", num);
|
snprintf(buf, sizeof(buf), "%u ", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,7 +85,7 @@ generic_totext_key(ARGS_TOTEXT) {
|
|||||||
/* flags */
|
/* flags */
|
||||||
flags = uint16_fromregion(&sr);
|
flags = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u", flags);
|
snprintf(buf, sizeof(buf), "%u", flags);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
if ((flags & DNS_KEYFLAG_KSK) != 0) {
|
if ((flags & DNS_KEYFLAG_KSK) != 0) {
|
||||||
@ -98,14 +98,14 @@ generic_totext_key(ARGS_TOTEXT) {
|
|||||||
|
|
||||||
|
|
||||||
/* protocol */
|
/* protocol */
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
/* algorithm */
|
/* algorithm */
|
||||||
algorithm = sr.base[0];
|
algorithm = sr.base[0];
|
||||||
sprintf(buf, "%u", algorithm);
|
snprintf(buf, sizeof(buf), "%u", algorithm);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
@ -161,7 +161,8 @@ generic_totext_key(ARGS_TOTEXT) {
|
|||||||
RETERR(str_totext(algbuf, target));
|
RETERR(str_totext(algbuf, target));
|
||||||
RETERR(str_totext(" ; key id = ", target));
|
RETERR(str_totext(" ; key id = ", target));
|
||||||
dns_rdata_toregion(rdata, &tmpr);
|
dns_rdata_toregion(rdata, &tmpr);
|
||||||
sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm));
|
snprintf(buf, sizeof(buf), "%u",
|
||||||
|
dst_region_computeid(&tmpr, algorithm));
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
@ -122,7 +122,7 @@ totext_keydata(ARGS_TOTEXT) {
|
|||||||
/* flags */
|
/* flags */
|
||||||
flags = uint16_fromregion(&sr);
|
flags = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u", flags);
|
snprintf(buf, sizeof(buf), "%u", flags);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
if ((flags & DNS_KEYFLAG_KSK) != 0) {
|
if ((flags & DNS_KEYFLAG_KSK) != 0) {
|
||||||
@ -134,14 +134,14 @@ totext_keydata(ARGS_TOTEXT) {
|
|||||||
keyinfo = "ZSK";
|
keyinfo = "ZSK";
|
||||||
|
|
||||||
/* protocol */
|
/* protocol */
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
/* algorithm */
|
/* algorithm */
|
||||||
algorithm = sr.base[0];
|
algorithm = sr.base[0];
|
||||||
sprintf(buf, "%u", algorithm);
|
snprintf(buf, sizeof(buf), "%u", algorithm);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
@ -184,7 +184,8 @@ totext_keydata(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, &tmpr);
|
dns_rdata_toregion(rdata, &tmpr);
|
||||||
/* Skip over refresh, addhd, and removehd */
|
/* Skip over refresh, addhd, and removehd */
|
||||||
isc_region_consume(&tmpr, 12);
|
isc_region_consume(&tmpr, 12);
|
||||||
sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm));
|
snprintf(buf, sizeof(buf), "%u",
|
||||||
|
dst_region_computeid(&tmpr, algorithm));
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
|
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
|
||||||
|
@ -62,7 +62,7 @@ totext_l32(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
@ -56,16 +56,16 @@ totext_l64(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
sprintf(buf, "%x:%x:%x:%x",
|
snprintf(buf, sizeof(buf), "%x:%x:%x:%x",
|
||||||
region.base[0]<<8 | region.base[1],
|
region.base[0]<<8 | region.base[1],
|
||||||
region.base[2]<<8 | region.base[3],
|
region.base[2]<<8 | region.base[3],
|
||||||
region.base[4]<<8 | region.base[5],
|
region.base[4]<<8 | region.base[5],
|
||||||
region.base[6]<<8 | region.base[7]);
|
region.base[6]<<8 | region.base[7]);
|
||||||
return (str_totext(buf, target));
|
return (str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,22 +478,31 @@ totext_loc(ARGS_TOTEXT) {
|
|||||||
|
|
||||||
size = sr.base[1];
|
size = sr.base[1];
|
||||||
INSIST((size&0x0f) < 10 && (size>>4) < 10);
|
INSIST((size&0x0f) < 10 && (size>>4) < 10);
|
||||||
if ((size&0x0f)> 1)
|
if ((size&0x0f)> 1) {
|
||||||
sprintf(sbuf, "%lum", (size>>4) * poweroften[(size&0x0f)-2]);
|
snprintf(sbuf, sizeof(sbuf),
|
||||||
else
|
"%lum", (size>>4) * poweroften[(size&0x0f)-2]);
|
||||||
sprintf(sbuf, "0.%02lum", (size>>4) * poweroften[(size&0x0f)]);
|
} else {
|
||||||
|
snprintf(sbuf, sizeof(sbuf),
|
||||||
|
"0.%02lum", (size>>4) * poweroften[(size&0x0f)]);
|
||||||
|
}
|
||||||
hp = sr.base[2];
|
hp = sr.base[2];
|
||||||
INSIST((hp&0x0f) < 10 && (hp>>4) < 10);
|
INSIST((hp&0x0f) < 10 && (hp>>4) < 10);
|
||||||
if ((hp&0x0f)> 1)
|
if ((hp&0x0f)> 1) {
|
||||||
sprintf(hbuf, "%lum", (hp>>4) * poweroften[(hp&0x0f)-2]);
|
snprintf(hbuf, sizeof(hbuf),
|
||||||
else
|
"%lum", (hp>>4) * poweroften[(hp&0x0f)-2]);
|
||||||
sprintf(hbuf, "0.%02lum", (hp>>4) * poweroften[(hp&0x0f)]);
|
} else {
|
||||||
|
snprintf(hbuf, sizeof(hbuf),
|
||||||
|
"0.%02lum", (hp>>4) * poweroften[(hp&0x0f)]);
|
||||||
|
}
|
||||||
vp = sr.base[3];
|
vp = sr.base[3];
|
||||||
INSIST((vp&0x0f) < 10 && (vp>>4) < 10);
|
INSIST((vp&0x0f) < 10 && (vp>>4) < 10);
|
||||||
if ((vp&0x0f)> 1)
|
if ((vp&0x0f)> 1) {
|
||||||
sprintf(vbuf, "%lum", (vp>>4) * poweroften[(vp&0x0f)-2]);
|
snprintf(vbuf, sizeof(vbuf),
|
||||||
else
|
"%lum", (vp>>4) * poweroften[(vp&0x0f)-2]);
|
||||||
sprintf(vbuf, "0.%02lum", (vp>>4) * poweroften[(vp&0x0f)]);
|
} else {
|
||||||
|
snprintf(vbuf, sizeof(vbuf),
|
||||||
|
"0.%02lum", (vp>>4) * poweroften[(vp&0x0f)]);
|
||||||
|
}
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
|
|
||||||
latitude = uint32_fromregion(&sr);
|
latitude = uint32_fromregion(&sr);
|
||||||
@ -542,11 +551,12 @@ totext_loc(ARGS_TOTEXT) {
|
|||||||
altitude -= 10000000;
|
altitude -= 10000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s",
|
snprintf(buf, sizeof(buf),
|
||||||
d1, m1, s1, fs1, north ? "N" : "S",
|
"%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s",
|
||||||
d2, m2, s2, fs2, east ? "E" : "W",
|
d1, m1, s1, fs1, north ? "N" : "S",
|
||||||
below ? "-" : "", altitude/100, altitude % 100,
|
d2, m2, s2, fs2, east ? "E" : "W",
|
||||||
sbuf, hbuf, vbuf);
|
below ? "-" : "", altitude/100, altitude % 100,
|
||||||
|
sbuf, hbuf, vbuf);
|
||||||
|
|
||||||
return (str_totext(buf, target));
|
return (str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ totext_lp(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
@ -101,7 +101,7 @@ totext_mx(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
@ -200,7 +200,7 @@ totext_naptr(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ totext_naptr(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
|
@ -56,16 +56,16 @@ totext_nid(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
sprintf(buf, "%x:%x:%x:%x",
|
snprintf(buf, sizeof(buf), "%x:%x:%x:%x",
|
||||||
region.base[0]<<8 | region.base[1],
|
region.base[0]<<8 | region.base[1],
|
||||||
region.base[2]<<8 | region.base[3],
|
region.base[2]<<8 | region.base[3],
|
||||||
region.base[4]<<8 | region.base[5],
|
region.base[4]<<8 | region.base[5],
|
||||||
region.base[6]<<8 | region.base[7]);
|
region.base[6]<<8 | region.base[7]);
|
||||||
return (str_totext(buf, target));
|
return (str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,19 +115,19 @@ totext_nsec3(ARGS_TOTEXT) {
|
|||||||
/* Hash */
|
/* Hash */
|
||||||
hash = uint8_fromregion(&sr);
|
hash = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", hash);
|
snprintf(buf, sizeof(buf), "%u ", hash);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/* Flags */
|
/* Flags */
|
||||||
flags = uint8_fromregion(&sr);
|
flags = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", flags);
|
snprintf(buf, sizeof(buf), "%u ", flags);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/* Iterations */
|
/* Iterations */
|
||||||
iterations = uint16_fromregion(&sr);
|
iterations = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%u ", iterations);
|
snprintf(buf, sizeof(buf), "%u ", iterations);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/* Salt */
|
/* Salt */
|
||||||
|
@ -109,13 +109,13 @@ totext_nsec3param(ARGS_TOTEXT) {
|
|||||||
iterations = uint16_fromregion(&sr);
|
iterations = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
|
|
||||||
sprintf(buf, "%u ", hash);
|
snprintf(buf, sizeof(buf), "%u ", hash);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
sprintf(buf, "%u ", flags);
|
snprintf(buf, sizeof(buf), "%u ", flags);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
sprintf(buf, "%u ", iterations);
|
snprintf(buf, sizeof(buf), "%u ", iterations);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
j = uint8_fromregion(&sr);
|
j = uint8_fromregion(&sr);
|
||||||
|
@ -109,7 +109,8 @@ totext_nxt(ARGS_TOTEXT) {
|
|||||||
target));
|
target));
|
||||||
} else {
|
} else {
|
||||||
char buf[sizeof("65535")];
|
char buf[sizeof("65535")];
|
||||||
sprintf(buf, "%u", t);
|
snprintf(buf, sizeof(buf),
|
||||||
|
"%u", t);
|
||||||
RETERR(str_totext(buf,
|
RETERR(str_totext(buf,
|
||||||
target));
|
target));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ totext_opt(ARGS_TOTEXT) {
|
|||||||
isc_region_consume(&r, 2);
|
isc_region_consume(&r, 2);
|
||||||
length = uint16_fromregion(&r);
|
length = uint16_fromregion(&r);
|
||||||
isc_region_consume(&r, 2);
|
isc_region_consume(&r, 2);
|
||||||
sprintf(buf, "%u %u", option, length);
|
snprintf(buf, sizeof(buf), "%u %u", option, length);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
INSIST(r.length >= length);
|
INSIST(r.length >= length);
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
|
@ -145,7 +145,7 @@ fromtext_rrsig(ARGS_FROMTEXT) {
|
|||||||
static inline isc_result_t
|
static inline isc_result_t
|
||||||
totext_rrsig(ARGS_TOTEXT) {
|
totext_rrsig(ARGS_TOTEXT) {
|
||||||
isc_region_t sr;
|
isc_region_t sr;
|
||||||
char buf[sizeof("4294967295")];
|
char buf[sizeof("4294967295")]; /* Also TYPE65000. */
|
||||||
dns_rdatatype_t covered;
|
dns_rdatatype_t covered;
|
||||||
unsigned long ttl;
|
unsigned long ttl;
|
||||||
unsigned long when;
|
unsigned long when;
|
||||||
@ -170,7 +170,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||||||
if (dns_rdatatype_isknown(covered) && covered != 0) {
|
if (dns_rdatatype_isknown(covered) && covered != 0) {
|
||||||
RETERR(dns_rdatatype_totext(covered, target));
|
RETERR(dns_rdatatype_totext(covered, target));
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "TYPE%u", covered);
|
snprintf(buf, sizeof(buf), "TYPE%u", covered);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -178,7 +178,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||||||
/*
|
/*
|
||||||
* Algorithm.
|
* Algorithm.
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -186,7 +186,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||||||
/*
|
/*
|
||||||
* Labels.
|
* Labels.
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -196,7 +196,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
ttl = uint32_fromregion(&sr);
|
ttl = uint32_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
sprintf(buf, "%lu", ttl);
|
snprintf(buf, sizeof(buf), "%lu", ttl);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
|
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
|
||||||
@ -224,7 +224,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
foot = uint16_fromregion(&sr);
|
foot = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu", foot);
|
snprintf(buf, sizeof(buf), "%lu", foot);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ totext_rt(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
dns_name_fromregion(&name, ®ion);
|
dns_name_fromregion(&name, ®ion);
|
||||||
|
@ -146,7 +146,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||||||
if (dns_rdatatype_isknown(covered) && covered != 0) {
|
if (dns_rdatatype_isknown(covered) && covered != 0) {
|
||||||
RETERR(dns_rdatatype_totext(covered, target));
|
RETERR(dns_rdatatype_totext(covered, target));
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%u", covered);
|
snprintf(buf, sizeof(buf), "%u", covered);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -154,7 +154,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||||||
/*
|
/*
|
||||||
* Algorithm.
|
* Algorithm.
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -162,7 +162,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||||||
/*
|
/*
|
||||||
* Labels.
|
* Labels.
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%u", sr.base[0]);
|
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
@ -172,7 +172,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
ttl = uint32_fromregion(&sr);
|
ttl = uint32_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
sprintf(buf, "%lu", ttl);
|
snprintf(buf, sizeof(buf), "%lu", ttl);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
foot = uint16_fromregion(&sr);
|
foot = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu", foot);
|
snprintf(buf, sizeof(buf), "%lu", foot);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ totext_sink(ARGS_TOTEXT) {
|
|||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
subcoding = uint8_fromregion(&sr);
|
subcoding = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u %u %u", meaning, coding, subcoding);
|
snprintf(buf, sizeof(buf), "%u %u %u", meaning, coding, subcoding);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
if (sr.length == 0U)
|
if (sr.length == 0U)
|
||||||
|
@ -128,7 +128,7 @@ totext_soa(ARGS_TOTEXT) {
|
|||||||
unsigned long num;
|
unsigned long num;
|
||||||
num = uint32_fromregion(&dregion);
|
num = uint32_fromregion(&dregion);
|
||||||
isc_region_consume(&dregion, 4);
|
isc_region_consume(&dregion, 4);
|
||||||
sprintf(buf, comm ? "%-10lu ; " : "%lu", num);
|
snprintf(buf, sizeof(buf), comm ? "%-10lu ; " : "%lu", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
if (comm) {
|
if (comm) {
|
||||||
RETERR(str_totext(soa_fieldnames[i], target));
|
RETERR(str_totext(soa_fieldnames[i], target));
|
||||||
|
@ -69,7 +69,7 @@ totext_sshfp(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -77,7 +77,7 @@ totext_sshfp(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u", n);
|
snprintf(buf, sizeof(buf), "%u", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -145,7 +145,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint32_fromregion(&sr);
|
n = uint32_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
sprintf(buf, "%lu ", n);
|
snprintf(buf, sizeof(buf), "%lu ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -153,7 +153,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint32_fromregion(&sr);
|
n = uint32_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
sprintf(buf, "%lu ", n);
|
snprintf(buf, sizeof(buf), "%lu ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -161,7 +161,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu ", n);
|
snprintf(buf, sizeof(buf), "%lu ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -172,7 +172,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
if (dns_tsigrcode_totext((dns_rcode_t)n, target) == ISC_R_SUCCESS)
|
if (dns_tsigrcode_totext((dns_rcode_t)n, target) == ISC_R_SUCCESS)
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
else {
|
else {
|
||||||
sprintf(buf, "%lu ", n);
|
snprintf(buf, sizeof(buf), "%lu ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu", n);
|
snprintf(buf, sizeof(buf), "%lu", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -209,7 +209,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint16_fromregion(&sr);
|
n = uint16_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 2);
|
isc_region_consume(&sr, 2);
|
||||||
sprintf(buf, "%lu", n);
|
snprintf(buf, sizeof(buf), "%lu", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -73,7 +73,7 @@ generic_totext_tlsa(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -81,7 +81,7 @@ generic_totext_tlsa(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u ", n);
|
snprintf(buf, sizeof(buf), "%u ", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -89,7 +89,7 @@ generic_totext_tlsa(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
n = uint8_fromregion(&sr);
|
n = uint8_fromregion(&sr);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u", n);
|
snprintf(buf, sizeof(buf), "%u", n);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -72,7 +72,7 @@ totext_uri(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
priority = uint16_fromregion(®ion);
|
priority = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u ", priority);
|
snprintf(buf, sizeof(buf), "%u ", priority);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -80,7 +80,7 @@ totext_uri(ARGS_TOTEXT) {
|
|||||||
*/
|
*/
|
||||||
weight = uint16_fromregion(®ion);
|
weight = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u ", weight);
|
snprintf(buf, sizeof(buf), "%u ", weight);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -107,7 +107,7 @@ totext_in_a6(ARGS_TOTEXT) {
|
|||||||
prefixlen = sr.base[0];
|
prefixlen = sr.base[0];
|
||||||
INSIST(prefixlen <= 128);
|
INSIST(prefixlen <= 128);
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
sprintf(buf, "%u", prefixlen);
|
snprintf(buf, sizeof(buf), "%u", prefixlen);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ totext_in_kx(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
|
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
@ -80,7 +80,7 @@ totext_in_nsap(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
RETERR(str_totext("0x", target));
|
RETERR(str_totext("0x", target));
|
||||||
while (region.length != 0) {
|
while (region.length != 0) {
|
||||||
sprintf(buf, "%02x", region.base[0]);
|
snprintf(buf, sizeof(buf), "%02x", region.base[0]);
|
||||||
isc_region_consume(®ion, 1);
|
isc_region_consume(®ion, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ totext_in_px(ARGS_TOTEXT) {
|
|||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
num = uint16_fromregion(®ion);
|
num = uint16_fromregion(®ion);
|
||||||
isc_region_consume(®ion, 2);
|
isc_region_consume(®ion, 2);
|
||||||
sprintf(buf, "%u", num);
|
snprintf(buf, sizeof(buf), "%u", num);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ totext_in_wks(ARGS_TOTEXT) {
|
|||||||
isc_region_consume(&sr, 4);
|
isc_region_consume(&sr, 4);
|
||||||
|
|
||||||
proto = uint8_fromregion(&sr);
|
proto = uint8_fromregion(&sr);
|
||||||
sprintf(buf, "%u", proto);
|
snprintf(buf, sizeof(buf), "%u", proto);
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
isc_region_consume(&sr, 1);
|
isc_region_consume(&sr, 1);
|
||||||
@ -209,7 +209,8 @@ totext_in_wks(ARGS_TOTEXT) {
|
|||||||
if (sr.base[i] != 0)
|
if (sr.base[i] != 0)
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
if ((sr.base[i] & (0x80 >> j)) != 0) {
|
if ((sr.base[i] & (0x80 >> j)) != 0) {
|
||||||
sprintf(buf, "%u", i * 8 + j);
|
snprintf(buf, sizeof(buf),
|
||||||
|
"%u", i * 8 + j);
|
||||||
RETERR(str_totext(" ", target));
|
RETERR(str_totext(" ", target));
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
}
|
}
|
||||||
|
@ -1046,8 +1046,10 @@ isc_httpd_response(isc_httpd_t *httpd) {
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(isc_buffer_used(&httpd->headerbuffer), "%s %03u %s\r\n",
|
snprintf(isc_buffer_used(&httpd->headerbuffer),
|
||||||
httpd->protocol, httpd->retcode, httpd->retmsg);
|
(int)isc_buffer_availablelength(&httpd->headerbuffer),
|
||||||
|
"%s %03u %s\r\n", httpd->protocol, httpd->retcode,
|
||||||
|
httpd->retmsg);
|
||||||
isc_buffer_add(&httpd->headerbuffer, needlen);
|
isc_buffer_add(&httpd->headerbuffer, needlen);
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
@ -1072,11 +1074,13 @@ isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (val != NULL)
|
if (val != NULL)
|
||||||
sprintf(isc_buffer_used(&httpd->headerbuffer),
|
snprintf(isc_buffer_used(&httpd->headerbuffer),
|
||||||
"%s: %s\r\n", name, val);
|
isc_buffer_availablelength(&httpd->headerbuffer),
|
||||||
|
"%s: %s\r\n", name, val);
|
||||||
else
|
else
|
||||||
sprintf(isc_buffer_used(&httpd->headerbuffer),
|
snprintf(isc_buffer_used(&httpd->headerbuffer),
|
||||||
"%s\r\n", name);
|
isc_buffer_availablelength(&httpd->headerbuffer),
|
||||||
|
"%s\r\n", name);
|
||||||
|
|
||||||
isc_buffer_add(&httpd->headerbuffer, needlen);
|
isc_buffer_add(&httpd->headerbuffer, needlen);
|
||||||
|
|
||||||
@ -1093,7 +1097,8 @@ isc_httpd_endheaders(isc_httpd_t *httpd) {
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(isc_buffer_used(&httpd->headerbuffer), "\r\n");
|
snprintf(isc_buffer_used(&httpd->headerbuffer),
|
||||||
|
isc_buffer_availablelength(&httpd->headerbuffer), "\r\n");
|
||||||
isc_buffer_add(&httpd->headerbuffer, 2);
|
isc_buffer_add(&httpd->headerbuffer, 2);
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
@ -1105,7 +1110,7 @@ isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
|
|||||||
unsigned int needlen;
|
unsigned int needlen;
|
||||||
char buf[sizeof "18446744073709551616"];
|
char buf[sizeof "18446744073709551616"];
|
||||||
|
|
||||||
sprintf(buf, "%d", val);
|
snprintf(buf, sizeof(buf), "%d", val);
|
||||||
|
|
||||||
needlen = strlen(name); /* name itself */
|
needlen = strlen(name); /* name itself */
|
||||||
needlen += 2 + strlen(buf); /* :<space> and val */
|
needlen += 2 + strlen(buf); /* :<space> and val */
|
||||||
@ -1117,8 +1122,9 @@ isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(isc_buffer_used(&httpd->headerbuffer),
|
snprintf(isc_buffer_used(&httpd->headerbuffer),
|
||||||
"%s: %s\r\n", name, buf);
|
isc_buffer_availablelength(&httpd->headerbuffer),
|
||||||
|
"%s: %s\r\n", name, buf);
|
||||||
|
|
||||||
isc_buffer_add(&httpd->headerbuffer, needlen);
|
isc_buffer_add(&httpd->headerbuffer, needlen);
|
||||||
|
|
||||||
|
@ -81,9 +81,11 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
|
|||||||
{
|
{
|
||||||
static const char *fmt = "%u.%u.%u.%u";
|
static const char *fmt = "%u.%u.%u.%u";
|
||||||
char tmp[sizeof("255.255.255.255")];
|
char tmp[sizeof("255.255.255.255")];
|
||||||
|
int n;
|
||||||
|
|
||||||
if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size)
|
|
||||||
{
|
n = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
|
||||||
|
if (n < 0 || (size_t)n >= size) {
|
||||||
errno = ENOSPC;
|
errno = ENOSPC;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -170,7 +172,8 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||||||
tp += strlen(tp);
|
tp += strlen(tp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tp += sprintf(tp, "%x", words[i]);
|
INSIST((tp - tmp) < sizeof(tmp));
|
||||||
|
tp += snprintf(tp, sizeof(tmp) - (tp - tmp), "%x", words[i]);
|
||||||
}
|
}
|
||||||
/* Was it a trailing run of 0x00's? */
|
/* Was it a trailing run of 0x00's? */
|
||||||
if (best.base != -1 && (best.base + best.len) ==
|
if (best.base != -1 && (best.base + best.len) ==
|
||||||
|
@ -1738,6 +1738,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
|||||||
isc_logmessage_t *message, *next;
|
isc_logmessage_t *message, *next;
|
||||||
isc_time_t oldest;
|
isc_time_t oldest;
|
||||||
isc_interval_t interval;
|
isc_interval_t interval;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
isc_interval_set(&interval,
|
isc_interval_set(&interval,
|
||||||
lcfg->duplicate_interval, 0);
|
lcfg->duplicate_interval, 0);
|
||||||
@ -1811,16 +1812,18 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
|||||||
* It wasn't in the duplicate interval,
|
* It wasn't in the duplicate interval,
|
||||||
* so add it to the message list.
|
* so add it to the message list.
|
||||||
*/
|
*/
|
||||||
message = isc_mem_get(lctx->mctx,
|
size = sizeof(isc_logmessage_t) +
|
||||||
sizeof(isc_logmessage_t) +
|
strlen(lctx->buffer) + 1;
|
||||||
strlen(lctx->buffer) + 1);
|
message = isc_mem_get(lctx->mctx, size);
|
||||||
if (message != NULL) {
|
if (message != NULL) {
|
||||||
/*
|
/*
|
||||||
* Put the text immediately after
|
* Put the text immediately after
|
||||||
* the struct. The strcpy is safe.
|
* the struct. The strcpy is safe.
|
||||||
*/
|
*/
|
||||||
message->text = (char *)(message + 1);
|
message->text = (char *)(message + 1);
|
||||||
strcpy(message->text, lctx->buffer);
|
size -= sizeof(isc_logmessage_t);
|
||||||
|
strlcpy(message->text, lctx->buffer,
|
||||||
|
size);
|
||||||
|
|
||||||
TIME_NOW(&message->time);
|
TIME_NOW(&message->time);
|
||||||
|
|
||||||
|
@ -2593,7 +2593,7 @@ json_renderctx(isc__mem_t *ctx, summarystat_t *summary, json_object *array) {
|
|||||||
ctxobj = json_object_new_object();
|
ctxobj = json_object_new_object();
|
||||||
CHECKMEM(ctxobj);
|
CHECKMEM(ctxobj);
|
||||||
|
|
||||||
sprintf(buf, "%p", ctx);
|
snprintf(buf, sizeof(buf), "%p", ctx);
|
||||||
obj = json_object_new_string(buf);
|
obj = json_object_new_string(buf);
|
||||||
CHECKMEM(obj);
|
CHECKMEM(obj);
|
||||||
json_object_object_add(ctxobj, "id", obj);
|
json_object_object_add(ctxobj, "id", obj);
|
||||||
|
@ -1983,7 +1983,7 @@ isc_taskmgr_renderjson(isc_taskmgr_t *mgr0, json_object *tasks) {
|
|||||||
CHECKMEM(taskobj);
|
CHECKMEM(taskobj);
|
||||||
json_object_array_add(array, taskobj);
|
json_object_array_add(array, taskobj);
|
||||||
|
|
||||||
sprintf(buf, "%p", task);
|
snprintf(buf, sizeof(buf), "%p", task);
|
||||||
obj = json_object_new_string(buf);
|
obj = json_object_new_string(buf);
|
||||||
CHECKMEM(obj);
|
CHECKMEM(obj);
|
||||||
json_object_object_add(taskobj, "id", obj);
|
json_object_object_add(taskobj, "id", obj);
|
||||||
|
@ -402,7 +402,8 @@ internal_current_clusteralias(isc_interfaceiter_t *iter) {
|
|||||||
memset(&iter->current, 0, sizeof(iter->current));
|
memset(&iter->current, 0, sizeof(iter->current));
|
||||||
iter->current.af = iter->clua_sa.sa_family;
|
iter->current.af = iter->clua_sa.sa_family;
|
||||||
memset(iter->current.name, 0, sizeof(iter->current.name));
|
memset(iter->current.name, 0, sizeof(iter->current.name));
|
||||||
sprintf(iter->current.name, "clua%d", ci.aliasid);
|
snprintf(iter->current.name, sizeof(iter->current.name),
|
||||||
|
"clua%d", ci.aliasid);
|
||||||
iter->current.flags = INTERFACE_F_UP;
|
iter->current.flags = INTERFACE_F_UP;
|
||||||
get_inaddr(&iter->current.address, &ci.addr);
|
get_inaddr(&iter->current.address, &ci.addr);
|
||||||
get_inaddr(&iter->current.netmask, &ci.netmask);
|
get_inaddr(&iter->current.netmask, &ci.netmask);
|
||||||
|
@ -6766,7 +6766,7 @@ isc_socketmgr_renderjson(isc_socketmgr_t *mgr0, json_object *stats) {
|
|||||||
|
|
||||||
LOCK(&sock->lock);
|
LOCK(&sock->lock);
|
||||||
|
|
||||||
sprintf(buf, "%p", sock);
|
snprintf(buf, sizeof(buf), "%p", sock);
|
||||||
obj = json_object_new_string(buf);
|
obj = json_object_new_string(buf);
|
||||||
CHECKMEM(obj);
|
CHECKMEM(obj);
|
||||||
json_object_object_add(entry, "id", obj);
|
json_object_object_add(entry, "id", obj);
|
||||||
|
@ -4151,7 +4151,7 @@ isc_socketmgr_renderjson(isc_socketmgr_t *mgr, json_object *stats) {
|
|||||||
|
|
||||||
LOCK(&sock->lock);
|
LOCK(&sock->lock);
|
||||||
|
|
||||||
sprintf(buf, "%p", sock);
|
snprintf(buf, sizeof(buf), "%p", sock);
|
||||||
obj = json_object_new_string(buf);
|
obj = json_object_new_string(buf);
|
||||||
CHECKMEM(obj);
|
CHECKMEM(obj);
|
||||||
json_object_object_add(entry, "id", obj);
|
json_object_object_add(entry, "id", obj);
|
||||||
|
@ -2913,8 +2913,8 @@ parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning,
|
|||||||
len = vsnprintf(message, sizeof(message), format, args);
|
len = vsnprintf(message, sizeof(message), format, args);
|
||||||
#define ELIPSIS " ... "
|
#define ELIPSIS " ... "
|
||||||
if (len >= sizeof(message)) {
|
if (len >= sizeof(message)) {
|
||||||
strcpy(message + sizeof(message) - sizeof(ELIPSIS) - 1,
|
message[sizeof(message) - sizeof(ELIPSIS)] = 0;
|
||||||
ELIPSIS);
|
strlcat(message, ELIPSIS, sizeof(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & (CFG_LOG_NEAR|CFG_LOG_BEFORE|CFG_LOG_NOPREP)) != 0) {
|
if ((flags & (CFG_LOG_NEAR|CFG_LOG_BEFORE|CFG_LOG_NOPREP)) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user